-
Notifications
You must be signed in to change notification settings - Fork 1
/
crc.java
76 lines (65 loc) · 1.73 KB
/
crc.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
import javax.swing.*;
import java.awt.*;
import java.applet.Applet.*;
import javax.swing.table.*;
import java.awt.event.*;
import javax.swing.event.*;
class crc extends JPanel implements ActionListener
{
JRadioButton r1,r2,r3;
JPanel p,p1;
JLabel l=new JLabel();
JFrame f=new JFrame();
public crc()
{
f.setVisible(true);
f.setTitle("CRC");
f.setBounds(250,250,540,370);
f.setResizable(false);
Image img=Toolkit.getDefaultToolkit().getImage("ddsm113.jpg");
f.setIconImage(img);
p=new JPanel();
p1=new JPanel();
l=new JLabel("C R C",JLabel.LEFT);
l.setFont(new Font("TimesRoman",Font.BOLD,30));
l.setForeground(Color.lightGray);
p1.setBackground(Color.darkGray);
p.setBackground(Color.gray);
p1.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
p.setLayout(new FlowLayout(FlowLayout.LEFT,230,70));
p1.add(l);
r1=new JRadioButton("Generate CRC");
r2=new JRadioButton("Verify CRC");
r3=new JRadioButton("Exit");
r1.setBackground(Color.gray);
r2.setBackground(Color.gray);
r3.setBackground(Color.gray);
r1.addActionListener(this);
r2.addActionListener(this);
r3.addActionListener(this);
p.add(r1);
p.add(r2);
p.add(r3);
f.getContentPane().add(p1,BorderLayout.NORTH);
f.getContentPane().add(p,BorderLayout.CENTER);
ButtonGroup bg=new ButtonGroup();
bg.add(r1);
bg.add(r2);
bg.add(r3);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==r1)
{
crcgen g=new crcgen();
}
else if(ae.getSource()==r2)
{
crcver g=new crcver();
}
else if(ae.getSource()==r3)
{ f.setVisible(false);
f.dispose();
}
}
}