//Title: Flight Reservation //Version: //Copyright: Copyright (c) 1998 //Author: Cheng Niu //Company: UB //Description: Your description import java.awt.*; import java.awt.event.*; import javax.swing.* ; public class ServiceDialog extends JDialog { JButton button1 = new JButton(); JTextField textField1 = new JTextField(); JButton button2 = new JButton(); JTextField textField2 = new JTextField(); JButton button3 = new JButton(); JList list1 = new JList(); JButton button4 = new JButton(); GridBagLayout gridBagLayout1 = new GridBagLayout(); public ServiceDialog(JFrame f, String s, boolean b) { super(f, s, b); try { jbInit(); } catch (Exception e) { e.printStackTrace(); } setSize(400,320); } private void jbInit() throws Exception { button1.setText("Reserve"); button2.setText("Cancel"); button3.setText("Get Update Infomation"); button4.setText("Close"); button4.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(MouseEvent e) { button4_mouseReleased(e); } }); this.getContentPane().setLayout(gridBagLayout1); this.getContentPane().add(button1, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER,GridBagConstraints.NONE, new Insets(12, 6, 0, 0), 73, 3)); this.getContentPane().add(textField1, new GridBagConstraints2(1, 0, 1, 1, 1.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 14, 0, 0), 214, 5)); this.getContentPane().add(button2, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(36, 6, 0, 0), 77, 5)); this.getContentPane().add(textField2, new GridBagConstraints2(1, 1, 1, 1, 1.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(32, 13, 0, 0), 215, 8)); this.getContentPane().add(button3, new GridBagConstraints2(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(29, 6, 0, 0), -5, 8)); this.getContentPane().add(list1, new GridBagConstraints2(1, 2, 1, 3, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(25, 13, 12, 0), 115, 69)); this.getContentPane().add(button4, new GridBagConstraints2(0, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(35, 6, 0, 0), 88, 5)); } void button4_mouseReleased(MouseEvent e) { setVisible(false); } }