Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > focus with multiple JOptionPane.showInputDialog calls

Thread Tools

focus with multiple JOptionPane.showInputDialog calls

Joseph M. DeAngelo
Posts: n/a
This must be simple but I can't get it. I have a simple standalone
java program that tries to issue more than one input request from a
Windows user. Here's the source:

import javax.swing.*;

public class focus
public static void main(String [] args)
String line;
JOptionPane pane ;

pane = new JOptionPane();
line = pane.showInputDialog("Prompt1");
line = pane.showInputDialog("Prompt2");



The first prompt brings up a dialog box that has keyboard input focus.
If I type in some data and hit enter, the 2nd input dialog comes up
but does not have the input focus. Is there any way to avoid having
to tap the mouse button?
I'm not a java programmer and am just trying to help someone else thru
a programing course.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Voipdiscount Outgoing Calls with Sipgate Incoming Calls on a Linksys PAP2 Giganews UK VOIP 27 10-09-2006 11:28 PM
ods calls business object then method calls ta with output params andy6 ASP .Net 2 06-09-2006 01:54 AM
MoVoIP - FREE MOBILE Inetrnet Phone Calls - FREE Internet Phone Calls ubifone VOIP 0 07-29-2005 04:31 PM
Sequence of constructor calls and destructor calls. Honne Gowda A C++ 2 10-31-2003 09:31 AM