-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPayment.java
More file actions
73 lines (60 loc) · 1.61 KB
/
Payment.java
File metadata and controls
73 lines (60 loc) · 1.61 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
package railwayreservation;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JRadioButton;
public class Payment extends JDialog implements ActionListener {
JButton cancel,proceed;
JRadioButton nb,cd;
public Payment() {
getContentPane().setLayout(null);
JLabel lblNewLabel = new JLabel("Payment type");
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 15));
lblNewLabel.setBounds(81, 41, 185, 28);
getContentPane().add(lblNewLabel);
proceed = new JButton("Proceed");
proceed.setBounds(33, 204, 89, 23);
getContentPane().add(proceed);
cancel = new JButton("Cancel");
cancel.setBounds(164, 204, 89, 23);
getContentPane().add(cancel);
cd = new JRadioButton("Credit Card");
cd.setBounds(77, 103, 109, 23);
getContentPane().add(cd);
nb = new JRadioButton("Net Banking");
nb.setBounds(77, 152, 109, 23);
getContentPane().add(nb);
ButtonGroup bg=new ButtonGroup();
bg.add(nb);
bg.add(cd);
proceed.addActionListener(this);
cancel.addActionListener(this);
setSize(300,300);
setVisible(true);
}
public static void main(String[] args) {
new Payment();
// TODO Auto-generated method stub
}
@Override
public void actionPerformed(ActionEvent e) {
Object ob=e.getSource();
if(ob==proceed)
{
if(cd.isSelected())
{
new CreditC();
dispose();
}
} else if(ob==cancel)
{
new ReservationForm();
dispose();
}
// TODO Auto-generated method stub
}
}