1 26 27 package org.objectweb.util.browser.core.panel; 28 29 30 import javax.swing.JLabel ; 31 import javax.swing.JTextField ; 32 import java.awt.Dimension ; 33 import javax.swing.BoxLayout ; 34 import javax.swing.Box ; 35 36 42 public class ParameterGUI extends Box { 43 44 protected Class class_; 45 protected JLabel label_; 46 protected JTextField value_; 47 48 public ParameterGUI(Class class_) { 49 super(BoxLayout.X_AXIS); 50 this.class_ = class_; 51 int lastIndex = class_.getName().lastIndexOf('.'); 52 if (lastIndex != -1) 53 label_ = new JLabel (class_.getName().substring(lastIndex + 1)); 54 else 55 label_ = new JLabel (class_.getName()); 56 label_.setPreferredSize(new Dimension (100, 20)); 57 add(label_); 58 value_ = new JTextField (15); 59 value_.setPreferredSize(new Dimension (330, 20)); 60 add(value_); 61 } 62 63 public Class getParameterClass() { 64 return class_; 65 } 66 67 public String getParameterValue() { 68 return value_.getText(); 69 } 70 } 71 | Popular Tags |