|
2 | 2 | import mdlaf.animation.MaterialUIMovement;
|
3 | 3 | import mdlaf.resources.MaterialColors;
|
4 | 4 |
|
5 |
| -import javax.swing.JButton; |
6 |
| -import javax.swing.JCheckBox; |
7 |
| -import javax.swing.JCheckBoxMenuItem; |
8 |
| -import javax.swing.JComboBox; |
9 |
| -import javax.swing.JEditorPane; |
10 |
| -import javax.swing.JFileChooser; |
11 |
| -import javax.swing.JFrame; |
12 |
| -import javax.swing.JLabel; |
13 |
| -import javax.swing.JMenu; |
14 |
| -import javax.swing.JMenuBar; |
15 |
| -import javax.swing.JMenuItem; |
16 |
| -import javax.swing.JPanel; |
17 |
| -import javax.swing.JPasswordField; |
18 |
| -import javax.swing.JProgressBar; |
19 |
| -import javax.swing.JRadioButton; |
20 |
| -import javax.swing.JRadioButtonMenuItem; |
21 |
| -import javax.swing.JScrollPane; |
22 |
| -import javax.swing.JSlider; |
23 |
| -import javax.swing.JSpinner; |
24 |
| -import javax.swing.JTabbedPane; |
25 |
| -import javax.swing.JTable; |
26 |
| -import javax.swing.JTextField; |
27 |
| -import javax.swing.JTextPane; |
28 |
| -import javax.swing.JToggleButton; |
29 |
| -import javax.swing.JToolBar; |
30 |
| -import javax.swing.JTree; |
31 |
| -import javax.swing.SpinnerListModel; |
32 |
| -import javax.swing.UIManager; |
33 |
| -import javax.swing.UnsupportedLookAndFeelException; |
| 5 | +import javax.swing.*; |
| 6 | +import javax.swing.event.ListDataListener; |
34 | 7 | import java.awt.BorderLayout;
|
35 | 8 | import java.awt.Color;
|
36 | 9 | import java.awt.Dimension;
|
| 10 | +import java.awt.event.ActionEvent; |
| 11 | +import java.util.ArrayList; |
| 12 | +import java.util.List; |
37 | 13 |
|
38 | 14 | public class MaterialUISwingDemo {
|
39 | 15 |
|
@@ -112,6 +88,25 @@ public static void main (String[] args) {
|
112 | 88 |
|
113 | 89 | JToolBar tb = new JToolBar ("toolbar");
|
114 | 90 | JButton button1 = new JButton ("f");
|
| 91 | + class ActionTest extends AbstractAction{ |
| 92 | + |
| 93 | + public ActionTest(){ |
| 94 | + putValue(Action.NAME, "f"); |
| 95 | + putValue(Action.SHORT_DESCRIPTION, "Test tool tip"); |
| 96 | + } |
| 97 | + |
| 98 | + @Override |
| 99 | + public void actionPerformed(ActionEvent e) { |
| 100 | + JDialog dialog = new JDialog(); |
| 101 | + JPanel jPanel = new JPanel(); |
| 102 | + jPanel.add(new JColorChooser()); |
| 103 | + dialog.setContentPane(jPanel); |
| 104 | + dialog.setLocationRelativeTo(null); |
| 105 | + dialog.setVisible(true); |
| 106 | + dialog.pack(); |
| 107 | + } |
| 108 | + } |
| 109 | + button1.setAction(new ActionTest()); |
115 | 110 | JButton button2 = new JButton ("e");
|
116 | 111 | button1.setBackground (MaterialColors.LIGHT_BLUE_400);
|
117 | 112 | button1.setForeground (Color.WHITE);
|
|
0 commit comments