Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

showInputDialog prefill
Is there a way I can prefill a JOptionPane.showInputDialog()?

(User fills in from scratch by I want to put something that s/he can
edit)


Report this thread to moderator Post Follow-up to this message
Old Post
alex_us01
03-30-08 12:29 AM


Re: showInputDialog prefill
On Sat, 29 Mar 2008 13:18:56 -0700 (PDT), alex_us01
<arisalex@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>Is there a way I can prefill a JOptionPane.showInputDialog()?
>
>(User fills in from scratch by I want to put something that s/he can
>edit)

the term you are looking for is "default", and yes.

String constellationName =
(String)JOptionPane.showInputDialog(
this,
"Enter unique new constellation name:",
"New Constellation",
JOptionPane.QUESTION_MESSAGE,
null /* icon */,
null /* possibilities */,
null /* default */ );
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Report this thread to moderator Post Follow-up to this message
Old Post
Roedy Green
03-30-08 12:29 AM


Re: showInputDialog prefill
I think there is a function in that class that lets u pass an array of
components to be displayed.

http://groups.google.com/group/java...eloupment?hl=en

Report this thread to moderator Post Follow-up to this message
Old Post
Chase Preuninger
03-31-08 03:06 AM


Re: showInputDialog prefill
On Mar 31, 4:48=A0am, Chase Preuninger <chasepreunin...@gmail.com>
wrote:
> I think there is a function in that class that lets u pass an array of
> components to be displayed.

Is this supposed to be a sig?  A sig. is normally
delimited by a single line containing '-- '*, followed
by a name or equivalent, then any message or
promotion such as..

> http://groups.google.SPAm/group/jav...oupment?hl=3Den

=2E.this.

See my reply for an example.

Be warned that I will report you to Google for
any further posts to the comp.lang.java.* groups
where you promote your toy group without any
attempt at a correct sig.

* But note that GG posters such as you and I
are unable to post correct sig. delimiters due
to our damaged WITUN.

--
Andrew T.
PhySci.org

Report this thread to moderator Post Follow-up to this message
Old Post
Andrew Thompson
04-01-08 03:26 AM


Re: showInputDialog prefill
alex_us01 wrote:
> Is there a way I can prefill a JOptionPane.showInputDialog()?
>
> (User fills in from scratch by I want to put something that s/he can
> edit)
>

There are many functions that do so.  Did you try Google?  Seriously, if
you know the class name, you should be able to find what you are looking
for in the online Javadocs.  It's the best way of looking stuff up, imo.

Google for "java classname se 6" to find the latest APIs.

For example, Google "java JOptionPane.showInputDialog se 6" goes here:

<http://java.sun.com/javase/6/docs/a...OptionPane.html>

And you can see there are several forms of showInputDialog() that allow
you to pass various values.  The last one in particular may be of
interest to you.



static String 	showInputDialog(Component parentComponent, Object message)
Shows a question-message dialog requesting input from the
user parented to parentComponent.

static String 	showInputDialog(Component parentComponent, Object
message, Object initialSelectionValue)

Shows a question-message dialog requesting input from the
user and parented to parentComponent.

static String 	showInputDialog(Component parentComponent, Object
message, String title, int messageType)

Shows a dialog requesting input from the user parented to
parentComponent with the dialog having the title title and message type
messageType.

static Object 	showInputDialog(Component parentComponent, Object
message, String title, int messageType, Icon icon, Object[]
selectionValues, Object initialSelectionValue)

Prompts the user for input in a blocking dialog where the
initial selection, possible selections, and all other options can be
specified.

static String 	showInputDialog(Object message)
Shows a question-message dialog requesting input from the user.

static String 	showInputDialog(Object message, Object initialSelectionValue)

Shows a question-message dialog requesting input from the
user, with the input value initialized to initialSelectionValue.



Report this thread to moderator Post Follow-up to this message
Old Post
Mark Space
04-02-08 12:45 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:25 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.