Re: JFormattedTextField - NumberFormat interferes with selectAll()
- From: "Jeff Higgins" <oohiggins@xxxxxxxxx>
- Date: Mon, 9 Apr 2007 00:54:10 -0400
Jeff Higgins wrote:
Hi,
The problem I'm having with the following code is:
When I construct the JFormattedTextFields with a
NumberFormat, the selectAll() method seems to have
no effect.
When I construct the JFormattedTextFields without a
NumberFormat, the selectAll() method seems to work
as I had expected; the JFormattedTextField gaining
focus has it's text selected.
test1Field = new
JFormattedTextField(NumberFormat.getIntegerInstance());
test1Field.setColumns(10);
test1Field.addFocusListener(this);
test2Field = new JFormattedTextField(NumberFormat.getNumberInstance());
test2Field.setColumns(10);
test2Field.addFocusListener(this);
Fixes problem (kinda, I think).
Now on to problems with InputVerifier.
test1Field = new JFormattedTextField(NumberFormat.getIntegerInstance());
test1Field.setFocusLostBehavior(JFormattedTextField.PERSIST);
test1Field.setColumns(10);
test1Field.addFocusListener(this);
test2Field = new JFormattedTextField(NumberFormat.getNumberInstance());
test2Field.setFocusLostBehavior(JFormattedTextField.PERSIST);
test2Field.setColumns(10);
test2Field.addFocusListener(this);
.
- References:
- JFormattedTextField - NumberFormat interferes with selectAll()
- From: Jeff Higgins
- JFormattedTextField - NumberFormat interferes with selectAll()
- Prev by Date: Re: Make first letter in string upper case, the rest in lowercase
- Next by Date: Re: Working with Nested Classes
- Previous by thread: JFormattedTextField - NumberFormat interferes with selectAll()
- Index(es):