Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JTable and JButton - Focus issue  RSS feed

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple GUI.
I have a JTable with some rows and columns.
I have a JButton.
Default JTable behaviour is that -
if you press "TAB" in the last cell, the cursor goes to the first cell.
But what I need is, if you press "TAB" in the last cell, the focus should go out of JTable and select the JButton.

How to achieve this?
 
Greenhorn
Posts: 23
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay Darryl is Correct : Ctrl + Tab is a good Alternative

Sorry Darryl I'll try to make my posts more meaningfull
 
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Digen Mahara wrote:You can use the nextFocusable() method i m not sure about the method's spelling but there is surely something if you are using an IDE search for such method

You can find it in JFrame class


Digen, have you ever heard of the Java API? Have you ever read the API for JFrame?
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Gurumurthy Ramamurthy wrote:I have a simple GUI.
I have a JTable with some rows and columns.
I have a JButton.
Default JTable behaviour is that -
if you press "TAB" in the last cell, the cursor goes to the first cell.
But what I need is, if you press "TAB" in the last cell, the focus should go out of JTable and select the JButton.

How to achieve this?


Press Ctrl-Tab to tab out of the table.

This is standard and expected GUI behavior, not just in Java but in all visual platforms.
 
Digen Mahara
Greenhorn
Posts: 23
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Darryl Burke wrote:

Digen Mahara wrote:You can use the nextFocusable() method i m not sure about the method's spelling but there is surely something if you are using an IDE search for such method

You can find it in JFrame class


Digen, have you ever heard of the Java API? Have you ever read the API for JFrame?



I was not sure as I mentioned, this was because I was a Former NetBeans user but later turned to Eclipse
and I think I saw it somewhere in properties window in NetBeans but I think I was Wrong and will see to it that I post proper suggesstions or codes
and try to help and understand more.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!