-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUIMainFrame.java
More file actions
113 lines (84 loc) · 2.8 KB
/
Copy pathGUIMainFrame.java
File metadata and controls
113 lines (84 loc) · 2.8 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.KeyEvent;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JRadioButtonMenuItem;
//Justin Yoo
//Program Description:
//Oct 18, 2024
public class GUIMainFrame extends JFrame
{
private static final long serialVersionUID = 1L;
private static JFrame frame;
public GUIMainFrame()
{
//Create and set up the window.
frame = new JFrame("GUIMain");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Add content to the window.
frame.add(new GUIMain(), BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
frame.setLocationRelativeTo(null); //centers
//JMENUS NOW:
JMenuBar menuBar;
JMenu menu, sortmenu, submenu, file, edit, view, tools;
JMenuItem menuItem;
JRadioButtonMenuItem rbMenuItem;
JCheckBoxMenuItem cbMenuItem;
menuBar = new JMenuBar();
//file
file = new JMenu("FILE");
file.setMnemonic(KeyEvent.VK_A);
file.getAccessibleContext().setAccessibleDescription("File");
menuBar.add(file);
//edit
edit = new JMenu("EDIT");
edit.setMnemonic(KeyEvent.VK_A);
edit.getAccessibleContext().setAccessibleDescription("Edit");
// menuBar.add(edit);
//view
view = new JMenu("VIEW");
view.setMnemonic(KeyEvent.VK_A);
view.getAccessibleContext().setAccessibleDescription("File");
// menuBar.add(view);
//tools
tools = new JMenu("TOOLS");
tools.setMnemonic(KeyEvent.VK_A);
tools.getAccessibleContext().setAccessibleDescription("TOOLS");
// menuBar.add(tools);
//file item
menuItem = new JMenuItem("Print",
KeyEvent.VK_T);
menuItem.getAccessibleContext().setAccessibleDescription(
"No Function Yet");
file.add(menuItem);
//view
sortmenu = new JMenu("Sort");
menuItem = new JMenuItem(new SortAction("by Course ID", "by Course ID"));
sortmenu.add(menuItem);
menuItem = new JMenuItem(new SortAction("by Name", "by Name"));
sortmenu.add(menuItem);
menuItem = new JMenuItem(new SortAction("by Number of Classes", "by Number of Classes"));
sortmenu.add(menuItem);
menuItem = new JMenuItem(new SortAction("by Semester Availability", "by Semester Availability"));
sortmenu.add(menuItem);
view.add(sortmenu);
//Dropdown
submenu = new JMenu("Download");
menuItem = new JMenuItem(".docx");
submenu.add(menuItem);
menuItem = new JMenuItem(".pdf");
submenu.add(menuItem);
menuItem = new JMenuItem(".jpeg");
submenu.add(menuItem);
file.add(submenu);
frame.setJMenuBar(menuBar);
}
}