647a9239d93c0571e5de542d8dda6e1bab859d4f
[idea/community.git] / samples / applicationConfigurable / src / MyPack / MyButtonListener.java
1 package MyPack;
2
3 import com.intellij.ide.ui.LafManager;
4 import com.intellij.ide.ui.UISettings;
5
6 import javax.swing.*;
7 import javax.swing.plaf.ButtonUI;
8 import java.awt.*;
9 import java.awt.event.ActionEvent;
10 import java.awt.event.ActionListener;
11
12 /**
13  * Created by IntelliJ IDEA.
14  * User: Alexey.Chursin
15  * Date: Aug 7, 2010
16  * Time: 9:36:45 PM
17
18  */
19 public class MyButtonListener implements ActionListener {
20
21
22     public JButton button;
23     public JComboBox myFontCombo;
24     public JComboBox myFontSize;
25
26
27       public void actionPerformed(ActionEvent e) {
28
29        UISettings settings = UISettings.getInstance();
30        LafManager lafManager = LafManager.getInstance();
31         // Restore default font
32        settings.FONT_FACE="Segoe UI";
33        settings.FONT_SIZE=12;
34        myFontCombo.setSelectedItem(settings.FONT_FACE);
35        myFontSize.setSelectedItem( String.valueOf(settings.FONT_SIZE));
36        settings.fireUISettingsChanged();
37        lafManager.updateUI();
38
39          
40
41
42       }
43
44  }
45