Java JSpinner setRightAlignment(JSpinner spinner)

Here you can find the source of setRightAlignment(JSpinner spinner)

Description

Align the spinner display to the right

License

Open Source License

Parameter

Parameter Description
spinner the spinner to update

Declaration

public static void setRightAlignment(JSpinner spinner) 

Method Source Code

//package com.java2s;
//  This software is released under the GNU General Public License.           //

import javax.swing.*;

public class Main {
    /**/*w  ww.  j a va  2  s  .  c o  m*/
     * Align the spinner display to the right
     *
     * @param spinner the spinner to update
     */
    public static void setRightAlignment(JSpinner spinner) {
        JSpinner.DefaultEditor editor;
        editor = (JSpinner.DefaultEditor) spinner.getEditor();
        editor.getTextField().setHorizontalAlignment(JTextField.RIGHT);
    }
}

Related

  1. getSpinnerIntValue(JSpinner spin)
  2. installSpinnerBugWorkaround(final JSpinner spinner)
  3. reattachChangeListeners(JSpinner spinner, ChangeListener[] listeners)
  4. replaceSpinnerValue(JSpinner spinner, double value)
  5. setList(JSpinner spinner, List values)
  6. setSpinnerFloatValue(JSpinner sp, float f)
  7. setSpinnerValue(JSpinner spinner, Integer i)