Here a little example
I start with a JFrame, a Button and an Actioininstance
- Code: Select all
public class TestFrame
extends JFrame {
private JButton btn;
private final Action action = new SwingAction();
public TestFrame() {
initialize();
}
I add a second action: action_1
- Code: Select all
private JButton btn;
private final Action action = new SwingAction();
private final Action action_1 = new SwingAction_1();
protected JButton getBtn() {
if (btn == null) {
btn = new JButton("New button");
btn.setAction(action_1);
}
return btn;
}
SwingDesigner show the fields "action" and "action_1" in the component tree and the Category Swing Actions of the Palette.
How do I erase the field(Instance) "action" from the design page?
Kind regards