On Thu, 24 Aug 2006 22:15:08 +0200, aurengo wrote:
> Hi,
>
[quoted text clipped - 8 lines]
>
> Thanks for your help and suggestions
Hi,
it's a known bug that JSlider ignores setFont().
So, extending JSlider with your own labels may be a good idea.
Or getting in touch with Java6? ;)
Ben
Michael Rauscher - 24 Aug 2006 22:16 GMT
Ben Kraufmann schrieb:
> On Thu, 24 Aug 2006 22:15:08 +0200, aurengo wrote:
>
[quoted text clipped - 14 lines]
>
> it's a known bug that JSlider ignores setFont().
It's not a bug, it's a feature (although I've to admit that it would
have been nice if the slider's font had been taken into account):
http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html
> So, extending JSlider with your own labels may be a good idea.
That is a bad idea. The OP simply needs to do what the documentation
tells him to do:
Font font = slider.getFont();
Dictionary dict = slider.getLabelTable();
for ( Enumeration e = dict.elements(); e.hasMoreElements(); ) {
Object element = e.nextElement();
if ( element instanceof JComponent ) {
((JComponent)element).setFont( font );
}
}
Bye
Michael