KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > matuschek > jobo > FilterConfigFrame


1 package net.matuschek.jobo;
2
3 import javax.swing.BoxLayout JavaDoc;
4 import javax.swing.JButton JavaDoc;
5 import javax.swing.JPanel JavaDoc;
6
7 import net.matuschek.swing.JHideFrame;
8 import net.matuschek.swing.OptionPanel;
9 /*********************************************
10     Copyright (c) 2001 by Daniel Matuschek
11  *********************************************/

12
13
14
15 /**
16  * Configuration dialog for filters
17  *
18  * @author Daniel Matuschek
19  * @version $Revision: 1.3 $
20  */

21 public class FilterConfigFrame extends JHideFrame {
22
23
24     private static final long serialVersionUID = -115214206470304510L;
25
26
27     public FilterConfigFrame() {
28         super("Filter configuration");
29         initComponents();
30     }
31
32
33     protected void initComponents() {
34         JPanel JavaDoc mainPanel = new JPanel JavaDoc();
35         mainPanel.setLayout(new BoxLayout JavaDoc(mainPanel,BoxLayout.Y_AXIS));
36         setContentPane(mainPanel);
37
38         OptionPanel dialogPanel = new OptionPanel(2);
39
40         JPanel JavaDoc buttonPanel = new JPanel JavaDoc();
41         buttonPanel.setLayout(new BoxLayout JavaDoc(buttonPanel,BoxLayout.X_AXIS));
42
43         mainPanel.add(dialogPanel);
44         mainPanel.add(buttonPanel);
45
46         /** Dialog panel **/
47         /** End of Dialog panel */
48
49         /** Button panel */
50         JButton JavaDoc okButton = new JButton JavaDoc();
51         okButton.setText("OK");
52         okButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
53             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
54                 updateAndHide();
55             }
56         });
57         buttonPanel.add(okButton);
58
59         JButton JavaDoc closeButton = new JButton JavaDoc();
60         closeButton.setText("Cancel");
61         closeButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
62             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
63                 exitForm();
64             }
65         });
66         buttonPanel.add(closeButton);
67         /** End of button panel */
68
69         pack ();
70     }
71
72
73     /**
74      * update the settings from the form contents and hide window
75      */

76     protected void updateAndHide() {
77         this.setVisible(false);
78     }
79
80
81     /**********************************************************************/
82     /**********************************************************************/
83     /**********************************************************************/
84
85 }
86
87
Popular Tags