1 package com.instantbank.common.uiutils;
2
3 import javax.swing.JPanel;
4 import javax.swing.JComboBox;
5 import javax.swing.JLabel;
6 import javax.swing.BoxLayout;
7 import java.awt.Color;
8 import java.awt.Dimension;
9 import javax.swing.border.EmptyBorder;
10
11
17 public class LabelCombo extends JPanel {
18
19
22 private JComboBox cbx = new JComboBox();
23
24
27 private JLabel lb = new JLabel();
28
29
30
39 public LabelCombo(String lbltext, String[] cbxtext, Color c,
40 Dimension d, EmptyBorder b) {
41 lb.setText(lbltext);
42 lb.setBorder(MiscDecoration.rBorder);
43 lb.setBackground(c);
44 for(int i = 0; i < cbxtext.length; i++) {
45 cbx.addItem(cbxtext[i]);
46 }
47
48 cbx.setPreferredSize(d);
49
50 this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
51 this.add(lb);
52 this.add(cbx);
53 this.setBackground(c);
54 if(b != null) {
55 this.setBorder(b);
56 }
57 }
58
59
60
65 public JLabel getLabel() {
66 return lb;
67 }
68
69
70
75 public JComboBox getCombo() {
76 return cbx;
77 }
78 }
79