[1] | 1 | package genius.gui;
|
---|
| 2 |
|
---|
| 3 | import java.awt.Dimension;
|
---|
| 4 |
|
---|
| 5 | import javax.swing.JFrame;
|
---|
| 6 | import javax.swing.JMenu;
|
---|
| 7 | import javax.swing.JMenuBar;
|
---|
| 8 | import javax.swing.JPanel;
|
---|
| 9 | import javax.swing.JSplitPane;
|
---|
| 10 | import javax.swing.JTabbedPane;
|
---|
| 11 |
|
---|
| 12 | import genius.gui.actions.AboutAction;
|
---|
| 13 | import genius.gui.actions.OpenManual;
|
---|
| 14 |
|
---|
| 15 | @SuppressWarnings("serial")
|
---|
| 16 | public class MainPanel extends JFrame {
|
---|
| 17 |
|
---|
| 18 | private JTabbedPane repoPanel = new JTabbedPane();
|
---|
| 19 | private JPanel negoPanel = new JPanel();
|
---|
| 20 |
|
---|
| 21 | public MainPanel() {
|
---|
| 22 | setMinimumSize(new Dimension(200, 100));
|
---|
| 23 | setTitle("GENIUS " + getClass().getPackage().getImplementationVersion());
|
---|
| 24 | JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, repoPanel, negoPanel);
|
---|
| 25 | add(splitpane);
|
---|
| 26 |
|
---|
| 27 | setJMenuBar(new MenuBar());
|
---|
| 28 |
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | public static void main(String[] args) {
|
---|
| 32 | MainPanel mainpanel = new MainPanel();
|
---|
| 33 | mainpanel.pack();
|
---|
| 34 | mainpanel.show();
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | class MenuBar extends JMenuBar {
|
---|
| 39 | private JMenu startMenu = new JMenu();
|
---|
| 40 | private JMenu helpMenu = new JMenu();
|
---|
| 41 |
|
---|
| 42 | public MenuBar() {
|
---|
| 43 | startMenu.setText("Start");
|
---|
| 44 | startMenu.setName("startMenu");
|
---|
| 45 | add(startMenu);
|
---|
| 46 |
|
---|
| 47 | helpMenu.setText("Help");
|
---|
| 48 | helpMenu.setName("startMenu");
|
---|
| 49 | helpMenu.add(new OpenManual());
|
---|
| 50 | helpMenu.add(new AboutAction());
|
---|
| 51 | add(helpMenu);
|
---|
| 52 | }
|
---|
| 53 | } |
---|