1 2 package org.netbeans.modules.form.layoutdesign; 3 4 public class ALT_ParallelPosition20 extends javax.swing.JFrame { 5 6 7 public ALT_ParallelPosition20() { 8 initComponents(); 9 } 10 11 16 private void initComponents() { 18 jTextField1 = new javax.swing.JTextField (); 19 jTextField2 = new javax.swing.JTextField (); 20 jTextField3 = new javax.swing.JTextField (); 21 jScrollPane1 = new javax.swing.JScrollPane (); 22 jList1 = new javax.swing.JList (); 23 24 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 25 jTextField1.setText("jTextField1"); 26 27 jTextField2.setText("jTextField2"); 28 29 jTextField3.setText("jTextField3"); 30 31 jList1.setModel(new javax.swing.AbstractListModel () { 32 String [] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; 33 public int getSize() { return strings.length; } 34 public Object getElementAt(int i) { return strings[i]; } 35 }); 36 jScrollPane1.setViewportView(jList1); 37 38 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); 39 getContentPane().setLayout(layout); 40 layout.setHorizontalGroup( 41 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 42 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() 43 .addContainerGap(187, Short.MAX_VALUE) 44 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) 45 .add(jTextField1, 0, 160, Short.MAX_VALUE) 46 .add(jTextField2) 47 .add(jTextField3)) 48 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 49 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 50 .addContainerGap()) 51 ); 52 layout.setVerticalGroup( 53 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 54 .add(layout.createSequentialGroup() 55 .addContainerGap() 56 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 57 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 58 .add(layout.createSequentialGroup() 59 .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 60 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 61 .add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 62 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 63 .add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) 64 .addContainerGap(157, Short.MAX_VALUE)) 65 ); 66 pack(); 67 } 69 72 public static void main(String args[]) { 73 java.awt.EventQueue.invokeLater(new Runnable () { 74 public void run() { 75 new ALT_ParallelPosition20().setVisible(true); 76 } 77 }); 78 } 79 80 private javax.swing.JList jList1; 82 private javax.swing.JScrollPane jScrollPane1; 83 private javax.swing.JTextField jTextField1; 84 private javax.swing.JTextField jTextField2; 85 private javax.swing.JTextField jTextField3; 86 88 } 89 | Popular Tags |