1 6 7 package org.netbeans.modules.piagetproject.gridsplit; 8 9 13 14 import java.awt.Component ; 16 import java.awt.GridBagConstraints ; 18 import java.awt.GridBagLayout ; 19 import java.awt.Insets ; 20 import javax.swing.AbstractAction ; 26 import javax.swing.JButton ; 27 import javax.swing.JComponent ; 29 import javax.swing.JFrame ; 30 import javax.swing.JPanel ; 33 37 38 public class TestComponent extends JPanel { 39 40 private int index; 41 Test t; 42 String s; 43 44 public TestComponent(Test test) { 45 t=test; 46 setLayout( new GridBagLayout () ); 47 this.index = Test.index++; 48 } 49 50 public void setID(String text){ 51 54 javax.swing.JTextField jTextField1 = new javax.swing.JTextField (); 55 jTextField1.setEditable(false); 56 jTextField1.setText("dsfafdaf\nalalalal"); 57 58 javax.swing.JTextArea jTextArea1 = new javax.swing.JTextArea (); 60 jTextArea1.setEditable(false); 61 jTextArea1.setText(text); 62 add(jTextArea1,new GridBagConstraints ( 0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets (0,0,0,0), 0 ,0 ) ); 63 64 } 65 66 public String toString() { 67 return "Comp " + index; 68 } 69 70 } 71 72 73 | Popular Tags |