|
Hello,
I'm working with a JSpinner and I need to set its' focus with a call to requestFocusInWindow(), but I forget how to get access to its' JTextField. I've tried saying "Spinner.requestFocusInWindow()" but that doesn't seem to do anything and I know the JSpinner has a JTextField which it uses to display and edit the value. I'd like to make a call like "Spinner.getTextField().requestFocusInWindow()" but I don't remember how to gain access to the JTextField (the aformentioned quote doesn't work). Does anybody know how to do this?
Gib
Replay:How to access JSpinner's JTextField?
its simply:
getValue(); however, this will return an "Object" so youll probably have to cast the return value as a String or whatever you want.
Replay:How to access JSpinner's JTextField?
This will give me the value entered into the JSpinner, and I could cast it as a String. But what I asked was, how do I set the focus for the JSpinner. JSpinner.requestFocusForWindow() doesn't work but I know it can be done, and it's done through calling requestFocusForWindow() on the embedded JTextField. JSpinner.getValue() will not give me the JTextField, and my question is: What will?
|