• Post Reply Bookmark Topic Watch Topic
  • New Topic

Weired Tabbing problem with textfields and labels ....

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a problem when I use a JLabel and a Jtextfield as I am forced to double tab to get the cursor in the textfield rather than single tabbing. when i remove the labels the problem disappears,ie tabbing moves the cursor between the textfields. Its as if the labels have a listener but this is not the case in my code.
I'm using JDK1.2.2 . Any ideas on this???
Thanks
Suhail
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can .setNextFocusableComponent(your other TextField);
That way, it knows where to tab to.
Also, if you code like this:
JLabel bla = new JLabel("bla");
JPanel.add(bla);
JTextField blaa = new JTextField(21);
JPanel.add(blaa);
then it will tab in that order. Try creating and adding all your labels and then create and add all your textfields together.
That may fix your problem also.

------------------
Happy Coding,
Gregg Bolinger
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!