1 39 40 41 package org.krysalis.jcharts.designer.common; 42 43 44 import javax.swing.*; 45 import java.awt.*; 46 47 48 public class LabelledCombo extends JPanel 49 { 50 private JLabel jLabel; 51 private JComboBox combo; 52 53 54 58 public LabelledCombo( String label, String [] comboValues ) 59 { 60 super(); 61 62 this.jLabel = new JLabel( label ); 63 this.combo = new JComboBox( comboValues ); 64 65 this.setLayout( new FlowLayout() ); 66 this.add( this.jLabel ); 67 this.add( this.combo ); 68 } 69 70 71 75 public String getSelected() 76 { 77 return (String ) this.combo.getSelectedItem(); 78 } 79 80 81 85 public int getSelectedIndex() 86 { 87 return this.combo.getSelectedIndex(); 88 } 89 } 90 | Popular Tags |