| |
e790. Setting the Margin Space on a JSpinner Component
// Create a number spinner
JSpinner spinner = new JSpinner();
// Get the text field
JFormattedTextField tf =
((JSpinner.DefaultEditor)spinner.getEditor()).getTextField();
// Set the margin (add two spaces to the left and right side of the value)
int top = 0;
int left = 2;
int bottom = 0;
int right = 2;
Insets insets = new Insets(top, left, bottom, right);
tf.setMargin(insets);
e786.
Creating a JSpinner Component
e787.
Creating an Hour JSpinner Component
e788.
Disabling Keyboard Editing in a JSpinner Component
e789.
Limiting the Values in a Number JSpinner Component
e791.
Customizing the Editor in a JSpinner Component
e792.
Creating a SpinnerListModel That Loops Through Its Values
e793.
Listening for Changes to the Value in a JSpinner Component
© 2002 Addison-Wesley.
|