Article View: borland.public.jbuilder.java.swing
Article #9842Setting selected button in JOptionPane
From: mitch
Date: Sat, 08 Jan 2000 00:00
Date: Sat, 08 Jan 2000 00:00
23 lines
1303 bytes
1303 bytes
I am using a JOptionPane, which uses the Yes_No_Option when calling showConfirmDialog, and I am trying to make the No buuton selected as default, but I can't seem to get it to work correctly, even though I have used 'setInitialValue' and 'selectInitialValue' methods, as follows: JOptionPane confirmCancel = new JOptionPane(); confirmCancel.setInitialValue(new Integer(JOptionPane.NO_OPTION)); selectedValue = confirmCancel.showConfirmDialog (this, "message", "title", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); confirmCancel.selectInitialValue(); Can anyone help? Cheers Sent via Deja.com http://www.deja.com/ Before you buy.
Technical Details
Message-ID:
<857aca$f5m$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,57efee13026db3a1,start X-Google-Attributes: gid111d45,public From: mitch <mitch_warner@yahoo.com> Subject: Setting selected button in JOptionPane Date: 2000/01/08 Message-ID: <857aca$f5m$1@nnrp1.deja.com> X-Deja-AN: 569853750 X-Http-Proxy: 1.1 bx6.deja.com:80 (Squid/1.1.22) for client 161.71.121.86 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sat Jan 08 12:25:52 2000 GMT X-MyDeja-Info: XMYDJUIDmitch_warner Newsgroups: borland.public.jbuilder.java.swing X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)