Board index » jbuilder » jSpinner foreground color not setable

jSpinner foreground color not setable


2004-07-15 08:26:50 PM
jbuilder16
Hello everybody
I am trying to set the foreground color of a JSpinner field, but it
appears always in black regardless what I set as the foreground color.
What's wrong here? I am using java version 1.4.1-b21
If this is a identifed Java bug, a link to a message explaining it
would be also very useful.
Regards,
Zoran
 
 

Re:jSpinner foreground color not setable

On Thu, 15 Jul 2004 14:26:50 +0200, Zoran Pjevic
< XXXX@XXXXX.COM >wrote:
Quote
I am trying to set the foreground color of a JSpinner field, but it
appears always in black regardless what I set as the foreground color.
I have a workarouns solution in the Java Technology Forum.
BAD:
spinner.setForeground(Color color)
GOOD:
JSpinner.DefaultEditor e =(JSpinner.DefaultEditor)spinner.getEditor();
JFormattedTextField TF=(JFormattedTextField)e.getTextField();
TF.setForeground(myColor);
Regards,
Zoran