-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUIPanel.java
More file actions
92 lines (74 loc) · 1.78 KB
/
GUIPanel.java
File metadata and controls
92 lines (74 loc) · 1.78 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
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTabbedPane;
/**
* The main frame containing all of the applications GUI.
*
* @author Joshua
* @version 1.0
*/
public class GUIPanel
{
private JFrame frame;
private JTabbedPane framePanel;
private BookPanel bk;
private MemberPanel m;
private BorrowPanel b;
/**
* Constructor sets up the entire GUI.
*/
public GUIPanel()
{
framePanel = new JTabbedPane();
bk = new BookPanel();
m = new MemberPanel();
b = new BorrowPanel();
framePanel.addTab("Books", bk);
framePanel.addTab("Members", m);
framePanel.addTab("Borrows & Returns", b);
framePanel.setOpaque(true);
createMenu();
frame = new JFrame("The Library Of Yore");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//frame.setJMenuBar(createMenu());
frame.setContentPane(framePanel);
frame.setLocation(100, 150);
frame.setSize(new Dimension(1200, 800));
frame.setResizable(true);
frame.setVisible(true);
}
/**
* Creates a menu bar (Unused)
*
* @return the created menu bar
*/
private JMenuBar createMenu()
{
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("File");
JMenuItem exitMI;
menuBar.add(menu);
exitMI = new JMenuItem("Quit");
exitMI.addActionListener(new ExitListener());
menu.add(exitMI);
return menuBar;
}
/**
* Exits the application (Unused)
*
* @author Joshua
* @version 1.0
*/
private class ExitListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}
}