-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenuFram.java
More file actions
176 lines (151 loc) · 7.76 KB
/
MainMenuFram.java
File metadata and controls
176 lines (151 loc) · 7.76 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package naeemmohammadprogrammingckpt3;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
/**
* This class represents as the MainMenuFram which displays option as main menu frame
* (first Jframe) of this project once the file is run.
*
* @author Mohammad Naeem
*/
public class MainMenuFram extends javax.swing.JFrame {
private BookStore myModel;
/**
* Creates new form PurchasingFram
*
* @param myModel
*/
public MainMenuFram(BookStore myModel) {
initComponents();
this.myModel = myModel;
featureComingSoon.setVisible(false);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
MainFramTitle = new javax.swing.JLabel();
ProceedToPurchaseButton = new javax.swing.JButton();
MembershipButton = new javax.swing.JButton();
HelpButton = new javax.swing.JButton();
featureComingSoon = new javax.swing.JLabel();
exitButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
MainFramTitle.setFont(new java.awt.Font("Sitka Heading", 3, 48)); // NOI18N
MainFramTitle.setForeground(new java.awt.Color(51, 0, 51));
MainFramTitle.setText(" Main Menu");
ProceedToPurchaseButton.setFont(new java.awt.Font("Sitka Subheading", 3, 24)); // NOI18N
ProceedToPurchaseButton.setForeground(new java.awt.Color(0, 153, 51));
ProceedToPurchaseButton.setText("<<< Proceed to Puchase >>>");
ProceedToPurchaseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ProceedToPurchaseButtonActionPerformed(evt);
}
});
MembershipButton.setFont(new java.awt.Font("Sitka Subheading", 3, 24)); // NOI18N
MembershipButton.setForeground(new java.awt.Color(0, 153, 51));
MembershipButton.setText(">>> Membership <<<");
MembershipButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MembershipButtonActionPerformed(evt);
}
});
HelpButton.setFont(new java.awt.Font("Sitka Subheading", 3, 24)); // NOI18N
HelpButton.setForeground(new java.awt.Color(0, 153, 51));
HelpButton.setText(">>>{e-Customer Service}<<<");
HelpButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
HelpButtonActionPerformed(evt);
}
});
featureComingSoon.setFont(new java.awt.Font("Sitka Subheading", 3, 18)); // NOI18N
featureComingSoon.setForeground(new java.awt.Color(0, 153, 51));
featureComingSoon.setText("Feature coming soon ...");
exitButton.setFont(new java.awt.Font("Sitka Subheading", 3, 24)); // NOI18N
exitButton.setForeground(new java.awt.Color(0, 153, 51));
exitButton.setText("<<< Exit >>>");
exitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(500, 500, 500)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(MainFramTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(ProceedToPurchaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(MembershipButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(HelpButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(exitButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addGap(589, 589, 589)
.addComponent(featureComingSoon)))
.addGap(500, 500, 500))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(MainFramTitle)
.addGap(104, 104, 104)
.addComponent(ProceedToPurchaseButton)
.addGap(93, 93, 93)
.addComponent(MembershipButton)
.addGap(18, 18, 18)
.addComponent(featureComingSoon)
.addGap(38, 38, 38)
.addComponent(HelpButton)
.addGap(55, 55, 55)
.addComponent(exitButton)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void MembershipButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MembershipButtonActionPerformed
// TODO add your handling code here:
featureComingSoon.setVisible(true);
}//GEN-LAST:event_MembershipButtonActionPerformed
private void HelpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_HelpButtonActionPerformed
// TODO add your handling code here:
Desktop browser = Desktop.getDesktop();
try {
browser.browse(new URI("http://www.google.com"));
} catch (IOException err) {
} catch (URISyntaxException err) {
}
}//GEN-LAST:event_HelpButtonActionPerformed
private void ProceedToPurchaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ProceedToPurchaseButtonActionPerformed
// TODO add your handling code here:
this.dispose();
PurchasingFram pFram = new PurchasingFram(myModel);
pFram.setVisible(true);
}//GEN-LAST:event_ProceedToPurchaseButtonActionPerformed
private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_exitButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton HelpButton;
private javax.swing.JLabel MainFramTitle;
private javax.swing.JButton MembershipButton;
private javax.swing.JButton ProceedToPurchaseButton;
private javax.swing.JButton exitButton;
private javax.swing.JLabel featureComingSoon;
// End of variables declaration//GEN-END:variables
}