Package jmri.util.swing
Class JComboBoxUtil
java.lang.Object
jmri.util.swing.JComboBoxUtil
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic <E,T extends JComboBox<E>>
voidsetupComboBoxMaxRows(T inComboBox) Set the maximum number of rows for a JComboBox so that it always can fit on the screen
-
Constructor Details
-
JComboBoxUtil
public JComboBoxUtil()
-
-
Method Details
-
setupComboBoxMaxRows
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
-