List of utility methods to do JComboBox
void | addHorizontalScrollBar(JComboBox box) add Horizontal Scroll Bar if (box.getItemCount() == 0) return; Object comp = box.getUI().getAccessibleChild(box, 0); if (!(comp instanceof JPopupMenu)) { return; JPopupMenu popup = (JPopupMenu) comp; int n = popup.getComponentCount(); ... |
void | addToCombo(JComboBox combo, Iterator it) This method automatically adds the contents of a data structured refered to by an iterator to a JComboBox instance.
while (it.hasNext()) {
combo.addItem(it.next());
|
void | addToComboBox(JComboBox list, Object object) add To Combo Box ComboBoxModel model = list.getModel(); if (model == null) { model = new DefaultComboBoxModel(); list.setModel(model); ; if (model instanceof DefaultComboBoxModel) { DefaultComboBoxModel listModel = (DefaultComboBoxModel) model; ... |
void | adjustComboBoxHeight(JComboBox comboBox) adjust Combo Box Height if (comboBox == null) { return; Font font = (Font) UIManager.getDefaults().get("ComboBox.font"); if (comboBox != null && font != null) { Dimension uiSize = comboBox.getUI().getPreferredSize(comboBox); FontMetrics fontMetrics = comboBox.getFontMetrics(font); int height = fontMetrics.getHeight() + fontMetrics.getDescent() + 3; ... |
void | adjustPopupWidth(JComboBox comboBox) Adjust popup for combo box, so that horizontal scrollbar will not display. |
void | adjustSize(JComboBox comboBox) adjust Size comboBox.setPreferredSize(new Dimension(0, FIELD_HEIGHT));
|
void | applyDefaultProperties(final JComboBox> comp) Sets default background and foreground color as well as a default font for the specified component. if (comp == null) { return; applyProperties(comp, "ComboBox.background", "ComboBox.foreground", "ComboBox.font"); |
void | CargarComboBox(JComboBox cb, List Cargar Combo Box Vector<T> v = new Vector<T>(); for (T p : lista) { v.add(p); cb.setModel(new DefaultComboBoxModel<T>(v)); |
void | checkJComboBoxNotEmpty(javax.swing.JComboBox check J Combo Box Not Empty if (!isJComboBoxNotEmpty(combo))
errors.add(promptName.getText());
|
void | comboBoxScroll(JComboBox box) combo Box Scroll if (box == null) { return; Object comp = box.getUI().getAccessibleChild(box, 0); if (!(comp instanceof JPopupMenu)) { return; JPopupMenu popup = (JPopupMenu) comp; ... |