@@ -69,6 +69,7 @@ public static void main (String[] args) {
69
69
jRadioButtonMenuItem .setText ("prova RadioButtonMenuItem" );
70
70
menu1 .add (jRadioButtonMenuItem );
71
71
menu1 .addSeparator ();
72
+
72
73
//TestCheckBoxMenuItem
73
74
JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem ();
74
75
checkBoxMenuItem .setText ("test" );
@@ -118,28 +119,31 @@ public static void main (String[] args) {
118
119
119
120
JToolBar tb = new JToolBar ("toolbar" );
120
121
JButton button1 = new JButton ("f" );
121
-
122
- button1 .setAction (new AbstractAction () {
123
- @ Override
124
- public void actionPerformed (ActionEvent e ) {
125
- putValue (Action .NAME , "f" );
126
- putValue (Action .SHORT_DESCRIPTION , "Test tool tip" );
127
-
128
- JDialog dialog = new JDialog ();
129
- JPanel jPanel = new JPanel ();
130
- jPanel .add (new JColorChooser ());
131
- dialog .setContentPane (jPanel );
132
- dialog .setLocationRelativeTo (null );
133
- dialog .setVisible (true );
134
- dialog .pack ();
135
- }
136
- });
137
-
138
122
JButton button2 = new JButton ("e" );
139
123
button1 .setBackground (MaterialColors .LIGHT_BLUE_400 );
140
124
button1 .setForeground (Color .WHITE );
141
125
button2 .setBackground (MaterialColors .LIGHT_BLUE_400 );
142
126
button2 .setForeground (Color .WHITE );
127
+ button1 .addMouseListener (MaterialUIMovement .getMovement (button1 , MaterialColors .LIGHT_BLUE_200 ));
128
+ button2 .addMouseListener (MaterialUIMovement .getMovement (button2 , MaterialColors .LIGHT_BLUE_200 ));
129
+
130
+ button1 .addActionListener (new AbstractAction () {
131
+ @ Override
132
+ public void actionPerformed (ActionEvent e ) {
133
+
134
+ putValue (Action .NAME , "f" );
135
+
136
+ JDialog dialog = new JDialog ();
137
+ JPanel jPanel = new JPanel ();
138
+ jPanel .add (new JColorChooser ());
139
+ dialog .setContentPane (jPanel );
140
+ dialog .setLocationRelativeTo (null );
141
+ dialog .pack ();
142
+ dialog .setVisible (true );
143
+ }
144
+ });
145
+ button1 .setToolTipText ("This is a tool tip" );
146
+
143
147
tb .add (button1 );
144
148
tb .addSeparator ();
145
149
tb .add (button2 );
@@ -192,6 +196,20 @@ public void actionPerformed (ActionEvent e) {
192
196
taskPane .setTitle ("Material Look and fell" );
193
197
pn .add (taskPane );
194
198
199
+ //Test effect mouse over
200
+
201
+ //Setting defoult
202
+ JButton testButtonHoverOne = new JButton ("Fly over me One" );
203
+ testButtonHoverOne .setEnabled (false );
204
+ pn .add (testButtonHoverOne );
205
+
206
+ //ModSetting
207
+ JButton testButtonHoverTwo = new JButton ("Fly over me Two" );
208
+ testButtonHoverTwo .setBackground (MaterialColors .LIGHT_BLUE_500 );
209
+ testButtonHoverTwo .setForeground (MaterialColors .WHITE );
210
+ testButtonHoverTwo .addMouseListener (MaterialUIMovement .getMovement (testButtonHoverTwo , MaterialColors .LIGHT_BLUE_200 ));
211
+ pn .add (testButtonHoverTwo );
212
+
195
213
// make everything visible to the world
196
214
frame .pack ();
197
215
frame .setVisible (true );
0 commit comments