}
}
});
controlsColumn.addButton("Set Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Color color = StyleUtil.randomColor();
textField.setForeground(color);
passwordField.setForeground(color);
textArea.setForeground(color);
}
});
controlsColumn.addButton("Clear Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
textField.setForeground(null);
passwordField.setForeground(null);
textArea.setForeground(null);
}
});
controlsColumn.addButton("Set Background", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Color color = StyleUtil.randomColor();
textField.setBackground(color);
passwordField.setBackground(color);
textArea.setBackground(color);
}
});
controlsColumn.addButton("Clear Background", new ActionListener() {
public void actionPerformed(ActionEvent e) {
textField.setBackground(null);
passwordField.setBackground(null);
textArea.setBackground(null);
}
});
controlsColumn.addButton("Change Disabled Border (All Attributes)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Border border = StyleUtil.randomBorder();
textField.setDisabledBorder(border);
passwordField.setDisabledBorder(border);
textArea.setDisabledBorder(border);
}
});
controlsColumn.addButton("Change Disabled Border Color", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Border border = textField.getDisabledBorder();
if (border == null) {
return;
}
border = new Border(border.getSize(), StyleUtil.randomColor(), border.getStyle());
textField.setDisabledBorder(border);
passwordField.setDisabledBorder(border);
textArea.setDisabledBorder(border);
}
});
controlsColumn.addButton("Change Disabled Border Size", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Border border = StyleUtil.nextBorderSize(textField.getDisabledBorder());
if (border == null) {
return;
}
textField.setDisabledBorder(border);
passwordField.setDisabledBorder(border);
textArea.setDisabledBorder(border);
}
});
controlsColumn.addButton("Change Disabled Border Style", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Border border = StyleUtil.nextBorderStyle(textField.getDisabledBorder());
if (border == null) {
return;
}
textField.setDisabledBorder(border);
passwordField.setDisabledBorder(border);
textArea.setDisabledBorder(border);
}
});
controlsColumn.addButton("Toggle Disabled Background Image", new ActionListener() {
public void actionPerformed(ActionEvent e) {
FillImage backgroundImage = textField.getDisabledBackgroundImage();
if (backgroundImage == null) {
textField.setDisabledBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
passwordField.setDisabledBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
textArea.setDisabledBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
} else {
textField.setDisabledBackgroundImage(null);
passwordField.setDisabledBackgroundImage(null);
textArea.setDisabledBackgroundImage(null);
}
}
});
controlsColumn.addButton("Set Disabled Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Color color = StyleUtil.randomColor();
textField.setDisabledForeground(color);
passwordField.setDisabledForeground(color);
textArea.setDisabledForeground(color);
}
});
controlsColumn.addButton("Clear Disabled Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
textField.setDisabledForeground(null);
passwordField.setDisabledForeground(null);
textArea.setDisabledForeground(null);
}
});
controlsColumn.addButton("Set Disabled Background", new ActionListener() {
public void actionPerformed(ActionEvent e) {
Color color = StyleUtil.randomColor();
textField.setDisabledBackground(color);
passwordField.setDisabledBackground(color);
textArea.setDisabledBackground(color);
}
});