Source code: javatools/swing/VariableSimpleFrame.java
1 /*
2 * VariableSimpleFrame.java
3 *
4 * Created on 16 luglio 2002, 19.38
5 Javatools (modified version) - Some useful general classes.
6 Copyright (C) 2002-2003 Chris Bitmead (original) Antonio Petrelli (modified)
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Contact me at: brenmcguire@users.sourceforge.net
23 */
24
25 package javatools.swing;
26
27 /** An empty frame, whose main panel can be set.
28 * @author Antonio Petrelli
29 * @version 0.0.1
30 */
31 public class VariableSimpleFrame extends javax.swing.JFrame {
32
33 /** Creates new form VariableSimpleFrame */
34 public VariableSimpleFrame() {
35 initComponents();
36 }
37
38 /** This method is called from within the constructor to
39 * initialize the form.
40 * WARNING: Do NOT modify this code. The content of this method is
41 * always regenerated by the Form Editor.
42 */
43 private void initComponents() {//GEN-BEGIN:initComponents
44
45 addWindowListener(new java.awt.event.WindowAdapter() {
46 public void windowClosing(java.awt.event.WindowEvent evt) {
47 exitForm(evt);
48 }
49 });
50
51 pack();
52 }//GEN-END:initComponents
53
54 /** Exit the Application */
55 private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
56 this.hide();
57 }//GEN-LAST:event_exitForm
58
59 /** Sets the panel to be displayed.
60 * @param pane The panel to be displayed.
61 */
62 public void setPanel(javax.swing.JPanel pane) {
63 getContentPane().removeAll();
64 getContentPane().add(pane, java.awt.BorderLayout.CENTER);
65 pack();
66 }
67
68 // Variables declaration - do not modify//GEN-BEGIN:variables
69 // End of variables declaration//GEN-END:variables
70
71 }