aspose file tools
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 The Software Craftsman this week in the Agile 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: 41599
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