-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainScreen.java
More file actions
62 lines (47 loc) · 1.38 KB
/
MainScreen.java
File metadata and controls
62 lines (47 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package GUI;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class MainScreen extends JFrame {
public static void main(String[] args) {
MainScreen frame = new MainScreen();
frame.setVisible(true);
}
/**
* Create the frame.
*/
public MainScreen() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 640, 438);
getContentPane().setLayout(null);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu mnGamers = new JMenu("Gamers");
menuBar.add(mnGamers);
JMenuItem mntmTictactoe = new JMenuItem("TicTacToe");
mntmTictactoe.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Demo2 obj = new Demo2();
obj.setVisible(true);
}
});
mnGamers.add(mntmTictactoe);
JMenuItem mntmLogoQuiz = new JMenuItem("Logo Quiz");
mnGamers.add(mntmLogoQuiz);
mnGamers.addSeparator();
JMenuItem mntmExit = new JMenuItem("Exit");
mnGamers.add(mntmExit);
JMenu mnHelp = new JMenu("Help");
menuBar.add(mnHelp);
JMenuItem mntmAboutus = new JMenuItem("AboutUs");
mnHelp.add(mntmAboutus);
setExtendedState(JFrame.MAXIMIZED_BOTH);
}
}