550 |
return tabs; |
return tabs; |
551 |
} |
} |
552 |
|
|
553 |
|
public static JComboBox mkComboBox(String[] names) |
554 |
|
{ |
555 |
|
JComboBox box = new JComboBox(names); |
556 |
|
return box; |
557 |
|
} |
558 |
|
|
559 |
public static JSpinner mkSpinner() |
public static JSpinner mkSpinner() |
560 |
{ |
{ |
561 |
JSpinner spinner = new JSpinner(); |
JSpinner spinner = new JSpinner(); |
675 |
return close; |
return close; |
676 |
} |
} |
677 |
|
|
678 |
|
public static JColorChooser mkColorChooser() |
679 |
|
{ |
680 |
|
return new JColorChooser(); |
681 |
|
} |
682 |
|
|
683 |
private static class PopUpAction |
private static class PopUpAction |
684 |
implements ActionListener |
implements ActionListener |
685 |
{ |
{ |
765 |
mkSpinner(), |
mkSpinner(), |
766 |
panel); |
panel); |
767 |
|
|
768 |
|
new PopUpAction("TextField", |
769 |
|
mkTextField("Hello, World!"), |
770 |
|
panel); |
771 |
|
|
772 |
|
new PopUpAction("ColorChooser", |
773 |
|
mkColorChooser(), |
774 |
|
panel); |
775 |
|
|
776 |
|
new PopUpAction("ComboBox", |
777 |
|
mkComboBox(new String[] {"Stop", |
778 |
|
"Software", |
779 |
|
"Hoarders", |
780 |
|
"Support", |
781 |
|
"GNU!"}), |
782 |
|
panel); |
783 |
|
|
784 |
JButton exitDisposer = mkDisposerButton(frame); |
JButton exitDisposer = mkDisposerButton(frame); |
785 |
panel.add(exitDisposer); |
panel.add(exitDisposer); |
786 |
|
|
787 |
return panel; |
return panel; |
788 |
} |
} |
789 |
|
|
790 |
|
public static JTextField mkTextField(String sometext) |
791 |
|
{ |
792 |
|
return new JTextField(sometext, 40); |
793 |
|
} |
794 |
} |
} |