KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > layoutdesign > ALT_Bug69497


1 package org.netbeans.modules.form.layoutdesign;
2
3 import java.util.Calendar JavaDoc;
4 import java.text.DateFormat JavaDoc;
5 import java.text.NumberFormat JavaDoc;
6 import java.text.SimpleDateFormat JavaDoc;
7 import javax.swing.JTextField JavaDoc;
8 import javax.swing.JOptionPane JavaDoc;
9
10 public class ALT_Bug69497 extends javax.swing.JFrame JavaDoc {
11
12     /** Creates new form BondCalculator */
13     public ALT_Bug69497() {
14         initComponents();
15     }
16
17     /** This method is called from within the constructor to
18      * initialize the form.
19      * WARNING: Do NOT modify this code. The content of this method is
20      * always regenerated by the Form Editor.
21      */

22     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
23
private void initComponents() {
24         myJPanel = new javax.swing.JPanel JavaDoc();
25         jLabel1 = new javax.swing.JLabel JavaDoc();
26         purchaseDateField = new javax.swing.JTextField JavaDoc();
27         jLabel3 = new javax.swing.JLabel JavaDoc();
28         purchasePriceField = new javax.swing.JTextField JavaDoc();
29         jLabel5 = new javax.swing.JLabel JavaDoc();
30         maturityDateField = new javax.swing.JTextField JavaDoc();
31         jLabel2 = new javax.swing.JLabel JavaDoc();
32         couponField = new javax.swing.JTextField JavaDoc();
33         jLabel7 = new javax.swing.JLabel JavaDoc();
34         callDateField = new javax.swing.JTextField JavaDoc();
35         jLabel6 = new javax.swing.JLabel JavaDoc();
36         callPriceField = new javax.swing.JTextField JavaDoc();
37
38         setTitle("Bond Calculator (alpha)");
39         addWindowListener(new java.awt.event.WindowAdapter JavaDoc() {
40             public void windowClosing(java.awt.event.WindowEvent JavaDoc evt) {
41                 exitForm(evt);
42             }
43         });
44
45         jLabel1.setText("Purchase Date");
46         jLabel1.setToolTipText("Purchase date of bond (MM/DD/YY)");
47
48         purchaseDateField.setColumns(10);
49
50         jLabel3.setText("Purchase Price");
51         jLabel3.setToolTipText("Purchase price of bond (e.g., 100)");
52
53         purchasePriceField.setColumns(10);
54
55         jLabel5.setText("Maturity Date");
56         jLabel5.setToolTipText("Maturity date of bond (MM/DD/YY)");
57
58         maturityDateField.setColumns(10);
59
60         jLabel2.setText("Coupon");
61         jLabel2.setToolTipText("Annual interest (e.g., 6.5)");
62
63         couponField.setColumns(10);
64
65         jLabel7.setText("Call Date");
66         jLabel7.setToolTipText("Call date of bond (MM/DD/YY)");
67
68         callDateField.setColumns(10);
69
70         jLabel6.setText("Call Price");
71         jLabel6.setToolTipText("Call price (e.g., 100)");
72
73         callPriceField.setColumns(10);
74
75         org.jdesktop.layout.GroupLayout myJPanelLayout = new org.jdesktop.layout.GroupLayout(myJPanel);
76         myJPanel.setLayout(myJPanelLayout);
77         myJPanelLayout.setHorizontalGroup(
78             myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
79             .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
80                 .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
81                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
82                         .addContainerGap()
83                         .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
84                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
85                         .addContainerGap()
86                         .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
87                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
88                         .addContainerGap()
89                         .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 90, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
90                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
91                         .addContainerGap()
92                         .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
93                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
94                         .addContainerGap()
95                         .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 62, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
96                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
97                         .addContainerGap()
98                         .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 62, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
99                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
100                 .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
101                     .add(callPriceField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
102                     .add(callDateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
103                     .add(maturityDateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
104                     .add(couponField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
105                     .add(purchasePriceField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
106                     .add(purchaseDateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
107                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
108         );
109         myJPanelLayout.setVerticalGroup(
110             myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
111             .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
112                 .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
113                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
114                         .add(17, 17, 17)
115                         .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
116                             .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
117                                 .add(2, 2, 2)
118                                 .add(purchaseDateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
119                                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
120                                 .add(purchasePriceField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
121                                 .add(36, 36, 36))
122                             .add(org.jdesktop.layout.GroupLayout.TRAILING, myJPanelLayout.createSequentialGroup()
123                                 .add(jLabel3)
124                                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
125                                 .add(jLabel5)
126                                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
127                                 .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
128                                     .add(maturityDateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
129                                     .add(jLabel2))
130                                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))))
131                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
132                         .addContainerGap()
133                         .add(jLabel1)))
134                 .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
135                     .add(org.jdesktop.layout.GroupLayout.LEADING, myJPanelLayout.createSequentialGroup()
136                         .add(couponField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
137                         .add(9, 9, 9)
138                         .add(callDateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
139                     .add(jLabel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
140                 .add(2, 2, 2)
141                 .add(myJPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
142                     .add(callPriceField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
143                     .add(jLabel6))
144                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
145         );
146         getContentPane().add(myJPanel, java.awt.BorderLayout.NORTH);
147
148         pack();
149     }// </editor-fold>//GEN-END:initComponents
150

151     /** Exit the Application */
152     private void exitForm(java.awt.event.WindowEvent JavaDoc evt) {//GEN-FIRST:event_exitForm
153
System.exit(0);
154     }//GEN-LAST:event_exitForm
155

156     /**
157     * @param args the command line arguments
158     */

159     public static void main(String JavaDoc args[]) {
160         java.awt.EventQueue.invokeLater(new Runnable JavaDoc() {
161             public void run() {
162                 appFrame = new ALT_Bug69497();
163                 appFrame.setVisible(true);
164             }
165         });
166     }
167
168     private static javax.swing.JFrame JavaDoc appFrame;
169
170     // Variables declaration - do not modify//GEN-BEGIN:variables
171
private javax.swing.JTextField JavaDoc callDateField;
172     private javax.swing.JTextField JavaDoc callPriceField;
173     private javax.swing.JTextField JavaDoc couponField;
174     private javax.swing.JLabel JavaDoc jLabel1;
175     private javax.swing.JLabel JavaDoc jLabel2;
176     private javax.swing.JLabel JavaDoc jLabel3;
177     private javax.swing.JLabel JavaDoc jLabel5;
178     private javax.swing.JLabel JavaDoc jLabel6;
179     private javax.swing.JLabel JavaDoc jLabel7;
180     private javax.swing.JTextField JavaDoc maturityDateField;
181     private javax.swing.JPanel JavaDoc myJPanel;
182     private javax.swing.JTextField JavaDoc purchaseDateField;
183     private javax.swing.JTextField JavaDoc purchasePriceField;
184     // End of variables declaration//GEN-END:variables
185

186 }
187
Popular Tags