View Javadoc
1   package edu.jiangxin.apktoolbox.help.settings;
2   
3   import edu.jiangxin.apktoolbox.swing.extend.EasyChildTabbedPanel;
4   import edu.jiangxin.apktoolbox.swing.extend.EasyPanel;
5   
6   import javax.swing.*;
7   
8   public class SettingsPanel extends EasyPanel {
9       private static final long serialVersionUID = 63924900336217723L;
10  
11      @Override
12      public void initUI() {
13          BoxLayout boxLayout = new BoxLayout(this, BoxLayout.Y_AXIS);
14          setLayout(boxLayout);
15  
16          JTabbedPane tabbedPane = new JTabbedPane();
17  
18          EasyChildTabbedPanel lookAndFeelPanel = new LookAndFeelPanel();
19          String lookAndFeelTitle = bundle.getString("help.settings.look.and.feel.title");
20          tabbedPane.addTab(lookAndFeelTitle, null, lookAndFeelPanel, lookAndFeelTitle);
21  
22          EasyChildTabbedPanel localePanel = new LocalePanel();
23          String localeTitle = bundle.getString("help.settings.locale.title");
24          tabbedPane.addTab(localeTitle, null, localePanel, localeTitle);
25  
26          EasyChildTabbedPanel alwaysOnTopPanel = new AlwaysOnTopPanel();
27          String alwaysOnTopTitle = bundle.getString("help.settings.always.on.top.title");
28          tabbedPane.addTab(alwaysOnTopTitle, null, alwaysOnTopPanel, alwaysOnTopTitle);
29  
30          EasyChildTabbedPanel dependencyPathPanel = new DependencyPathPanel();
31          String dependencyPathTitle = bundle.getString("help.settings.dependency.path");
32          tabbedPane.addTab(dependencyPathTitle, null, dependencyPathPanel, dependencyPathTitle);
33  
34          tabbedPane.addChangeListener(e -> {
35              EasyChildTabbedPanel selectedPanel = (EasyChildTabbedPanel) tabbedPane.getSelectedComponent();
36              selectedPanel.onTabSelected();
37          });
38  
39          tabbedPane.setSelectedComponent(dependencyPathPanel);
40          dependencyPathPanel.onTabSelected();
41  
42          add(tabbedPane);
43          add(Box.createVerticalGlue());
44      }
45  
46  }
47