Weired Tabbing problem with textfields and labels ....
posted 15 years ago
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
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.