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 LabelComboCombo extends JPanel {
18
19
22 private JComboBox cbxBig = new JComboBox();
23
24
27 private JComboBox cbxSmall = new JComboBox();
28
29
32 private JLabel lb = new JLabel();
33
34
35
46 public LabelComboCombo(String lbltext, String[] cbxtextBig,
47 String[] cbxtextSmall, Color c,
48 Dimension dBig, Dimension dSmall, EmptyBorder b) {
49 lb.setText(lbltext);
50 lb.setBorder(MiscDecoration.rBorder);
51 lb.setBackground(c);
52 for(int i = 0; i < cbxtextBig.length; i++) {
53 cbxBig.addItem(cbxtextBig[i]);
54 }
55
56 for(int i = 0; i < cbxtextSmall.length; i++) {
57 cbxSmall.addItem(cbxtextSmall[i]);
58 }
59
60 cbxBig.setPreferredSize(dBig);
61 cbxSmall.setPreferredSize(dSmall);
62
63 this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
64 this.add(lb);
65 this.add(cbxBig);
66 this.add(cbxSmall);
67 this.setBackground(c);
68 if(b != null) {
69 this.setBorder(b);
70 }
71 }
72
73
74
79 public JLabel getLabel() {
80 return lb;
81 }
82
83
84
89 public JComboBox getBigCombo() {
90 return cbxBig;
91 }
92
93
94
99 public JComboBox getSmallCombo() {
100 return cbxSmall;
101 }
102
103
104
109 public void setEnabled(boolean mode) {
110 cbxSmall.setEnabled(mode);
111 cbxBig.setEnabled(mode);
112 }
113
114 }
115