<Swing Dev> Background/Foreground colors and Gtk Look and Feel
Joel Uckelman
uckelman at nomic.net
Thu Jan 22 21:21:46 UTC 2009
Hi,
I'm the guy who reported the bug which Omair was referring to. The context
in which in which I noticed that the GTK L&F ignores setBackground() is
that I was subclassing JTextPane in order to get a label which would support
both word wrap and full justification of text. In this case, the correct
background color is really not what the theme thinks the background color
should be for a JTextPane, but rather what the theme thinks the background
color should be for a JLabel.
This kind of policy makes the uses to which components can be put very narrow
if you're using a native L&F. To be clear: What I want to achieve is to have
this component of mine to have the same background color as a JLabel, because
it *is* functionally a JLabel, despite that it inherits from JTextPane. I'm not
trying to circumvent the color scheme provided by the L&F here, I'm trying to
follow it---so it's very disheartening to read the replies on this thread.
If the intended behavior of native L&Fs is to ignore setBackground(), then
what's the right way to do what I'm trying to do?
--
J.
More information about the swing-dev
mailing list