use of megameklab.com.ui.util.TechComboBox in project megameklab by MegaMek.
the class PatchworkArmorView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
setLayout(new GridBagLayout());
setBorder(BorderFactory.createTitledBorder(// $NON-NLS-1$
null, // $NON-NLS-1$
resourceMap.getString("ArmorAllocationView.panPatwork.title"), TitledBorder.TOP, TitledBorder.DEFAULT_POSITION));
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.insets = new Insets(0, 5, 0, 5);
for (int loc = 0; loc < MAX_LOC; loc++) {
JLabel label = new JLabel();
TechComboBox<EquipmentType> combo = new TechComboBox<>(eq -> eq.getName());
combo.setActionCommand(Integer.toString(loc));
combo.addActionListener(this);
labels.add(label);
combos.add(combo);
gbc.gridx = 0;
gbc.anchor = GridBagConstraints.EAST;
add(label, gbc);
gbc.gridx = 1;
gbc.anchor = GridBagConstraints.WEST;
add(combo, gbc);
gbc.gridy++;
}
}
Aggregations