Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > JColorChooser d...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15927 of 16566
Post > Topic >>

JColorChooser default button, TableDialogEditDemo

by "John B. Matthews" <nospam@[EMAIL PROTECTED] > Mar 30, 2008 at 11:35 AM

I'm puzzled by the behavior of TableDialogEditDemo

<http://java.sun.com/docs/books/tutorial/uiswing/examples/zipfiles/compon
ents-TableDialogEditDemoProject.zip>

under Java 1.5.0_13, on Mac OS 10.4.11. The first time the JColorChooser  
dialog is displayed, the OK button is the default; on subsequent 
invocations, no default appears. The relevant code in CellEditor.java 
instantiates JColorChooser and creates a dialog

colorChooser = new JColorChooser();
dialog = JColorChooser.createDialog(...)

The code then reveals the dialog in the actionPerformed() method, when a  
table cell is clicked:

dialog.setVisible(true);

Although it's a bit slower, the problem does not occur if the dialog is 
re-created each time:

newColor = JColorChooser.showDialog(null, "Choose...", currentColor);

Is this a platform anomaly? Is there a way to set the default button 
before making the dialog visible?

Thanks for any insights,

John
-- 
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
 




 1 Posts in Topic:
JColorChooser default button, TableDialogEditDemo
"John B. Matthews&qu  2008-03-30 11:35:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 16:17:40 CST 2008.