Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using JOtionPane

 
sara Jacob
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using Joptionpane which displays a pannel contains a table and a text.
optionpane's control is in OK button (by default).how can i chage it to the table in the pannel,so that i can choose a row using keyboard
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Not sure I understand the question, but the whole idea of the Dialog in JOptionPane is that it is "modal." It takes the focus from the rest of the app and won't allow you to access it until you dismiss the dialogue.
If you need access to the app then you will have to find a way to create a non-modal dialogue window, or (preferably) not use a dialogue in the first place.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add a timer (just before you show the optionPane), 250ms, repeats false,
with the action table.requestFocusInWindow()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic