This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Removing a component from tab order Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Removing a component from tab order" Watch "Removing a component from tab order" New topic
Author

Removing a component from tab order

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I would like to remove a few components from the tab order in a JPanel.
So they only obtain focus if click on. Does someone know how to do this?

Thanks.
Priyaa V Kumar
Ranch Hand

Joined: Aug 12, 2004
Posts: 32
Try something like this. Supposing you have four textfields in a Jpanel,

jPanel1.add(jTextField1, new XYConstraints(72, 5, 120, -1));
jPanel1.add(jTextField2, new XYConstraints(72, 48, 120, 21));
jPanel1.add(jTextField3, new XYConstraints(72, 90, 120, 21));
jPanel1.add(jTextField4, new XYConstraints(72, 133, 120, 21));

Adding a line this, would skip textfield2 from Tab order. ie. Tabbing goes to first field, third field, fourth field and then would go to first field

jTextField1.setNextFocusableComponent(jTextField3);
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Removing a component from tab order
 
Similar Threads
how to skip tab order from non-editable column
Tabbing bewteen textfields
how to avoid tab order into noneditable column?(urgent)
Eclipse not seeing updated JAR in tomcat\lib library at runtime
SQL command to show tables