This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JTable and JButton - Focus issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable and JButton - Focus issue" Watch "JTable and JButton - Focus issue" New topic
Author

JTable and JButton - Focus issue

Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 272
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?
Digen Mahara
Greenhorn

Joined: Dec 23, 2011
Posts: 23

Okay Darryl is Correct : Ctrl + Tab is a good Alternative

Sorry Darryl I'll try to make my posts more meaningfull


To every Tunnel there is always a way out
So keep Trying...
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4530
    
    5

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?


luck, db
There are no new questions, but there may be new answers.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4530
    
    5

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

Joined: Dec 23, 2011
Posts: 23

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable and JButton - Focus issue