Here you can find the source of setRightAlignment(JSpinner spinner)
Parameter | Description |
---|---|
spinner | the spinner to update |
public static void setRightAlignment(JSpinner spinner)
//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); } }