public class DecimalInput extends Object
JPanel
which used GridBagLayout
.Modifier and Type | Field and Description |
---|---|
static String |
DOUBLE_FORMAT |
static String |
FLOAT_FORMAT |
static String |
INTEGER_FORMAT |
Constructor and Description |
---|
DecimalInput(String labelText,
JPanel panel,
int x,
int y,
String format) |
DecimalInput(String labelText,
JPanel panel,
int x,
int y,
String format,
boolean showSlider) |
DecimalInput(String labelText,
JPanel panel,
int y,
String format) |
Modifier and Type | Method and Description |
---|---|
protected Hashtable<Integer,JLabel> |
createLabelTable(int sliderMax,
int sliderStep,
double valueMax) |
SwingChangeMonitor |
getChangeMonitor() |
DecimalFormat |
getDecimalFormat() |
JLabel |
getLabel() |
JFormattedTextField |
getTextField() |
double |
parseDouble()
Parses the current value of the text field.
|
float |
parseFloat()
Parses the current value of the text field.
|
int |
parseInt()
Parses the current value as an
int . |
long |
parseLong()
Parses the current value as an
long . |
void |
setDecimalFormatStr(String format) |
void |
setEnabled(boolean enabled) |
void |
setValue(double value) |
void |
setValue(float value) |
void |
setValue(int value) |
void |
setValue(long value) |
public static final String DOUBLE_FORMAT
public static final String FLOAT_FORMAT
public static final String INTEGER_FORMAT
public DecimalInput(String labelText, JPanel panel, int y, String format)
public DecimalInput(String labelText, JPanel panel, int x, int y, String format)
public DecimalInput(String labelText, JPanel panel, int x, int y, String format, boolean showSlider)
public JFormattedTextField getTextField()
public SwingChangeMonitor getChangeMonitor()
public void setEnabled(boolean enabled)
public DecimalFormat getDecimalFormat()
public void setDecimalFormatStr(String format)
public float parseFloat()
public double parseDouble()
public int parseInt()
int
.public long parseLong()
long
.protected Hashtable<Integer,JLabel> createLabelTable(int sliderMax, int sliderStep, double valueMax)
public void setValue(float value)
public void setValue(double value)
public void setValue(int value)
public void setValue(long value)