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

