Package jmri.util.swing
Class JComboBoxUtil
- java.lang.Object
-
- jmri.util.swing.JComboBoxUtil
-
public class JComboBoxUtil extends java.lang.Object
Common utility methods for working with JComboBoxes.To do vertical sizing of empty JComboBoxen, this will create a dummy object and cast it to the contents' type. This can fail.
- Since:
- 4.9.5
-
-
Constructor Summary
Constructors Constructor Description JComboBoxUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E,T extends javax.swing.JComboBox<E>>
voidsetupComboBoxMaxRows(T inComboBox)
Set the maximum number of rows for a JComboBox so that it always can fit on the screen
-
-
-
Constructor Detail
-
JComboBoxUtil
public JComboBoxUtil()
-
-
Method Detail
-
setupComboBoxMaxRows
public static <E,T extends javax.swing.JComboBox<E>> void setupComboBoxMaxRows(T inComboBox)
Set the maximum number of rows for a JComboBox so that it always can fit on the screenTo do vertical sizing of empty JComboBoxen, this will create a temporary String and use that to set a default height based on the current font settings.
- Type Parameters:
E
- type of JComboBox contentsT
- subclass of JComboBox being setup- Parameters:
inComboBox
- the JComboBox to setup
-
-