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 within JDialog  - Focus Problem 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 within JDialog  - Focus Problem" Watch "JTable within JDialog  - Focus Problem" New topic
Author

JTable within JDialog - Focus Problem

iyappan sankaran
Ranch Hand

Joined: Aug 11, 2003
Posts: 58
hi guys,

i written a Jtable within a JDialog.Using keymapping i register few keys.the problem is once i launch the application the focus is on JTable not in Jdilog .so while i press key the evnts are associted with table not with dialog.

how to change the focus to dialog from table. i always want the focus is on dialog.

thanks
iyappan sankaran
Ranch Hand

Joined: Aug 11, 2003
Posts: 58
Few explanations towards problem

Here the event is consumed by table. so we have to redirect the evnts to dialog. There is one possiblity using KeyEventDispatch interface provides option of redirect the event.

but i want to make use of "registerKeyboardAction" how to do
pls help me.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
do you have setModal(true) for the dialog?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JTable within JDialog - Focus Problem