-
Notifications
You must be signed in to change notification settings - Fork 1
/
menu.java
268 lines (200 loc) · 6.1 KB
/
menu.java
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.sql.*;
public class menu extends JFrame implements ActionListener
{
JMenuItem it1,it2,it3,it4,it5,it6,it7,it8,it9,it10,it11,it12,it13;
Calendar d=Calendar.getInstance();
JLabel dl=new JLabel(" ",JLabel.LEFT);
int day,mon,yr;
String dt;
menu()
{
JFrame f=new JFrame(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
f.setSize(screenSize);
f.setResizable(false);
Container cp=f.getContentPane();
day=d.get(Calendar.DATE);
mon=d.get(Calendar.MONTH)+1;
yr=d.get(Calendar.YEAR);
dt="DATE :- "+day+"/"+mon+"/"+yr;
dl.setText(dt);
dl.setSize(200,25);
int k=(screenSize.width)-175;
dl.setLocation(k,675);
dl.setFont(new Font("Courier",Font.BOLD,15));
dl.setForeground(Color.white);
cp.setLayout(null);
JLabel label=new JLabel();
ImageIcon ic11=new ImageIcon("toplogo.jpg");
label.setIcon(ic11);
label.setSize(1024,256); //screenSize.width
label.setLocation(0,0);
ImageIcon ic12=new ImageIcon("cube.gif"); //
JLabel label1=new JLabel();
label1.setIcon(ic12);
label1.setSize(400,256);
//label.setSize(screenSize.width,105);
label.setLocation(320,0);
cp.add(label);
cp.setBackground(Color.gray);
JMenuBar bar = new JMenuBar( );
bar.setSize(250,20);int i=((screenSize.width)/2)-125;
bar.setLocation(i-20,260);int j=((screenSize.width)/2)-175;
label1.setLocation(j+25,320);
bar.setBorderPainted(true);
cp.add(bar);
cp.add(dl);
cp.add(label1);
JMenu data = new JMenu(" DATA ");
data.setMnemonic(KeyEvent.VK_D);
it1 = new JMenuItem(" CRC ");
it1.setMnemonic(KeyEvent.VK_C);
it2 = new JMenuItem("EMBED");
it2.setMnemonic(KeyEvent.VK_E);
it3 = new JMenuItem("DE-EMBED");
it3.setMnemonic(KeyEvent.VK_D);
data.add(it1);
data.add(it2);
data.add(it3);
it1.addActionListener(this);
it2.addActionListener(this);
it3.addActionListener(this);
JMenu utilities = new JMenu(" UTILITIES ");
utilities.setMnemonic(KeyEvent.VK_U);
it4 = new JMenuItem("COMPRESS");
it4.setMnemonic(KeyEvent.VK_O);
it5 = new JMenuItem("DECOMPRESS");
it5.setMnemonic(KeyEvent.VK_P);
it10 = new JMenuItem("SEND");
it10.setMnemonic(KeyEvent.VK_S);
utilities.add(it4);
utilities.add(it5);
utilities.add(it10);
it4.addActionListener(this);
it5.addActionListener(this);
it10.addActionListener(this);
JMenu help = new JMenu(" HELP ");
help.setMnemonic(KeyEvent.VK_H);
it6 = new JMenuItem("ABOUT");
it6.setMnemonic(KeyEvent.VK_A);
help.add(it6);
it7 = new JMenuItem("CONTENTS");
it7.setMnemonic(KeyEvent.VK_N);
help.add(it7);
it8 = new JMenuItem("INFRMATION");
it8.setMnemonic(KeyEvent.VK_I);
help.add(it8);
it6.addActionListener(this);
it7.addActionListener(this);
it8.addActionListener(this);
JMenu exit=new JMenu("EXIT");
exit.setMnemonic(KeyEvent.VK_X);
it9 = new JMenuItem( "EXIT ");
it9.setMnemonic(KeyEvent.VK_T);
exit.add(it9);
it9.addActionListener(new ActionListener() {
public void actionPerformed (ActionEvent e) {
System.exit(0);
}
});
bar.add(data);
bar.add(utilities);
bar.add(help);
bar.add(exit);
//f.setLocation(200,100);
f.setVisible(true);
f.setTitle("Digital Security System");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
System.out.println("in end of if1");
}//menu cons
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==it1)
{
crc x=new crc();
repaint();
}
else if(ae.getSource()==it2)
{
embed x=new embed();
repaint();
}
else if(ae.getSource()==it3)
{
dembed x=new dembed();
repaint();
}
else if(ae.getSource()==it4)
{
compress x=new compress();
repaint();
}
else if(ae.getSource()==it5)
{
Decompress x=new Decompress();
repaint();
}
else if(ae.getSource()==it6)
{
about();
}
else if(ae.getSource()==it7)
{
tables x=new tables();
repaint();
}
else if(ae.getSource()==it8)
{
index x=new index();
repaint();
}
else if(ae.getSource()==it10)
{
sen d=new sen();
repaint();
}
}//actionperformed
void about()
{
JFrame f1=new JFrame();
Image img=Toolkit.getDefaultToolkit().getImage("ddsm113.jpg");
f1.setIconImage(img);
final JDialog dialog = new JDialog (f1, "About...", true);
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {dialog.dispose();}
});
JLabel lab1 = new JLabel ("Image Stegnography", JLabel.CENTER);
lab1.setFont(new Font("TimesRoman",Font.BOLD+Font.ITALIC,20));
lab1.setForeground(Color.gray);
JLabel lab2 = new JLabel ("Version 1.0", JLabel.CENTER);
JLabel lab3 = new JLabel ("Copyright(c) 2012-2013 by", JLabel.CENTER);
JLabel lab4 = new JLabel ("K SURAJ", JLabel.CENTER);
JLabel lab51 = new JLabel ("K SURABHI", JLabel.CENTER);
JLabel lab61 = new JLabel ("POOJA PRASANNAN", JLabel.CENTER);
dialog.getContentPane().setLayout(new GridLayout(5,1,0,0));
dialog.getContentPane().add (lab1);
dialog.getContentPane().add (lab2);
dialog.getContentPane().add (lab3);
dialog.getContentPane().add (lab4);
JButton butt = new JButton("Close");
JPanel p=new JPanel();
p.add(butt);
dialog.getContentPane().add(p);
butt.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
dialog.setVisible(false);
dialog.dispose();
}
});
dialog.setBounds(325,250,390,370);
dialog.setVisible(true);
}//abt
public static void main(String s[])
{
//Sp sppp= new Sp();
menu m=new menu();
}
}//menuClass END