Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enable/disable JOptionPane button

575 views
Skip to first unread message

Fred

unread,
Jan 30, 2009, 2:41:28 PM1/30/09
to
I create a dialog using a JOptionPane:

Object options[] = {"OK", "Apply", "Cancel"};
wOptionPane = new JOptionPane( child, messageType,
JOptionPane.DEFAULT_OPTION,
null, options, null );

When I make the dialog visible, I sometimes want to
disable one or more of the option buttons until the
user has input valid data that makes the action of
that button meaningful.

How can I retrieve the buttons that the JOptionPane
creates for the options? Or is my only choice to create
all the buttons myself instead of letting the JOptionPane
create them?

--
Fred K.

Knute Johnson

unread,
Jan 30, 2009, 11:42:37 PM1/30/09
to

I think the latter is your only option.

--

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

saj...@retailcloud.com

unread,
Jun 13, 2019, 3:36:52 AM6/13/19
to
You can create buttons and add to options instead only adding button text, so that you can do anything to your buttons
0 new messages