-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersonDetailForm.java
More file actions
134 lines (102 loc) · 2.94 KB
/
PersonDetailForm.java
File metadata and controls
134 lines (102 loc) · 2.94 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
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
@SuppressWarnings("all")
public class PersonDetailForm extends JFrame implements ActionListener
{
private JTextField txt_Name,txt_City,txt_State, txt_Country,txt_Pincode;
private JComboBox cho_Entryid;
private JTextArea txt_Address;
private JButton cmd_Addnew,cmd_Update,cmd_Delete,cmd_Close;
private boolean operation;
public PersonDetailForm(String fname)
{
super(fname);
operation=false;
cho_Entryid=new JComboBox();
txt_Name=new JTextField(25);
txt_Address=new JTextArea(5,25);
txt_City=new JTextField(15);
txt_State=new JTextField(15);
txt_Country=new JTextField(15);
txt_Pincode=new JTextField(10);
//cmd_Addnew=new JButton("Add New");
cmd_Update=new JButton("Update");
cmd_Delete=new JButton("Delete");
cmd_Close=new JButton("Close");
//getEntryID();
getContentPane().setLayout(new BorderLayout());
JPanel panel1=new JPanel();
panel1.setLayout(new GridLayout(4,4,10,5));
panel1.add(new JLabel("Entry id : "));
panel1.add(cho_Entryid);
panel1.add(new JLabel("Person Name : "));
panel1.add(txt_Name);
panel1.add(new JLabel("Address : "));
panel1.add(txt_Address);
panel1.add(new JLabel("City : "));
panel1.add(txt_City);
panel1.add(new JLabel("State : "));
panel1.add(txt_State);
panel1.add(new JLabel("Country : "));
panel1.add(txt_Country);
panel1.add(new JLabel("Pin Code : "));
panel1.add(txt_Pincode);
JPanel panel2=new JPanel();
panel2.setLayout(new FlowLayout());
//panel2.add(cmd_Addnew);
panel2.add(cmd_Update);
panel2.add(cmd_Delete);
panel2.add(cmd_Close);
getContentPane().add(new JLabel("Personal Details"),BorderLayout.NORTH);
getContentPane().add(panel1,BorderLayout.CENTER);
getContentPane().add(panel2,BorderLayout.SOUTH);
addWindowListener(new MyWindowAdapter());
//cmd_Addnew.addActionListener(this);
cmd_Update.addActionListener(this);
cmd_Delete.addActionListener(this);
cmd_Close.addActionListener(this);
}
/* public void getEntryID()
{
try
{
FileInputStream fis=new FileInputStream("address.dat");
ObjectInputStream ois=new ObjectInputStream(fis);
} catch(){}
}*/
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==cmd_Update)
{
/* txt_Entryid.setText(getNewID());
txt_Name.setText("");
txt_Address.setText("");
txt_City.setText("");
txt_State.setText("");
txt_Country.setText("");
txt_Pincode.setText("");*/
}
else if(ae.getSource()==cmd_Delete)
{
}
else if(ae.getSource()==cmd_Close)
{
}
}
/* String getNewID()
{
try
{
//FileInputStream fis=new FileInputStream("Address.dat");
}
}*/
class MyWindowAdapter extends WindowAdapter
{
public void windowClosing(WindowEvent we)
{
dispose();
}
}
}