Here you can find the source of setEditable(JSpinner spinner, boolean bool)
Parameter | Description |
---|---|
spinner | the spinner to update |
bool | true if editable, false otherwise |
public static void setEditable(JSpinner spinner, boolean bool)
//package com.java2s; // This software is released under the GNU General Public License. // import javax.swing.*; public class Main { /**// ww w .j a va2 s . c o m * Make the spinner text field editable, or not * * @param spinner the spinner to update * @param bool true if editable, false otherwise */ public static void setEditable(JSpinner spinner, boolean bool) { JSpinner.DefaultEditor editor; editor = (JSpinner.DefaultEditor) spinner.getEditor(); editor.getTextField().setEditable(bool); } }