This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes using JOtionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "using JOtionPane" Watch "using JOtionPane" New topic

using JOtionPane

sara Jacob

Joined: Jun 26, 2008
Posts: 1
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

Joined: Oct 13, 2005
Posts: 45292
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

Joined: Jun 09, 2003
Posts: 4632
add a timer (just before you show the optionPane), 250ms, repeats false,
with the action table.requestFocusInWindow()
I agree. Here's the link:
subject: using JOtionPane
It's not a secret anymore!