Setting foreground of disabled JSpinner does not work

import java.awt.Color;

import javax.swing.JFrame;

import javax.swing.JSpinner;

import javax.swing.JSpinner.DefaultEditor;

publicclass SpinnerForeground

{

publicstaticvoid main(String args[])

{

JSpinner sp =new JSpinner();

sp.setEnabled(false);

sp.setForeground(Color.RED);

((DefaultEditor)sp.getEditor()).getTextField().setForeground(Color.RED);

JFrame f =new JFrame();

f.getContentPane().add(sp);

f.pack();

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);

}

}

Unfortunately, the foreground color of the disabled spinner is not red (It works if the spinner is enabled).

Can anyone help?

Thanx,

Martin

[1298 byte] By [silverblue700a] at [2007-11-27 4:23:20]
# 1
((DefaultEditor)sp.getEditor()).getTextField().setDisabledTextColor(Color.YELLOW);
Michael_Dunna at 2007-7-12 9:30:55 > top of Java-index,Desktop,Core GUI APIs...
# 2
Great, thanks a lot
silverblue700a at 2007-7-12 9:30:55 > top of Java-index,Desktop,Core GUI APIs...