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