• Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane Modal Internal Frame Focus Traversal

 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,
Below is a small java program that uses JOptionPane to create a modal internal frame displaying a message and three buttons.
My problem is that although the internal frame's orientation is right-to-left, the keyboard focus traversal is left-to-right.
Initially, when the modal internal frame is displayed, the middle button has the focus (which is my intention). However, if you hit the <TAB> key on the keyboard, the rightmost button acquires the focus but I wish the leftmost button to acquire the focus.
How do I achieve this?

 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you'll find all necessary information in Java Tutorial here: http://download.oracle.com/javase/tutorial/uiswing/misc/focus.html, 'Customizing Focus Traversal' part.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrey,
Thanks for your reply.
You made me realize that I ommitted an important point from my original post.
I am aware that I can customize the focus traversal for the JOptionPane, however I was hoping to be shown an alternative solution.

Cheers,
Avi.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!