Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2398

Re: JScrollpane calors

From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.help
Subject Re: JScrollpane calors
Date 2012-12-27 09:32 -0500
Organization The Wasteland
Message-ID <nospam-F824DA.09320627122012@news.aioe.org> (permalink)
References <kbdofo$lr8$1@speranza.aioe.org> <nospam-4940A6.23342725122012@news.aioe.org> <kbec5g$odp$1@speranza.aioe.org> <nospam-E7F2D0.11274926122012@news.aioe.org> <kbgbdf$9m2$1@speranza.aioe.org>

Show all headers | View raw


In article <kbgbdf$9m2$1@speranza.aioe.org>, emf <emfril@gmail.com> 
wrote:

> On 2012-12-26 11:27 John B. Matthews wrote:
> > In article <kbec5g$odp$1@speranza.aioe.org>, emf <emfril@gmail.com>
> > wrote:
> >
> >> On 2012-12-25 23:34 John B. Matthews wrote:
> >>> In article <kbdofo$lr8$1@speranza.aioe.org>, emf <emfril@gmail.com>
> >>> wrote:
> > [...]
> >>> You can change the defaults, before instantiating any GUI objects,
> >>> but the chosen Look and Feel is free to ignore some or all
> >>> settings.
> >>>
> >>> UIManager.put("ScrollBar.foreground", ...);
> >>> UIManager.put("ScrollBar.background", ...);
> > [...]
> >> Well, they were partially effective, I mean the second was effective,
> >> the background did change to the color I specified, but the
> >> foreground, that is the scroller itself, did not change from what it
> >> was before.
> >>
> >> Why?
> > [...]
> >
> > You'd have to examine the particular implementation to see how it uses
> > the foreground color. I generally try to avoid distorting the L&F
> > design. Of course, you can always override the relevant paint method(s)
> > in a custom BasicScrollBarUI.
> 
> Sorry, I need more specific directions than this. But I googled the 
> issue and find that this should be a solution:
> 
> public TextPaneRenderer() {
>       setEditable(false);
>       putClientProperty(HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
> }
> 
> (https://forums.oracle.com/forums/thread.jspa?threadID=2269764)
> 
> But where do I put it?

HONOR_DISPLAY_PROPERTIES is documented for JTextPane, but I'm not aware 
of any such client property for JScrollBar.

Just to get the flavor of it, here's a custom SliderUI:

<http://stackoverflow.com/a/6996263/230513>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JScrollpane calors emf <emfril@gmail.com> - 2012-12-25 21:52 -0500
  Re: JScrollpane calors "John B. Matthews" <nospam@nospam.invalid> - 2012-12-25 23:34 -0500
    Re: JScrollpane calors emf <emfril@gmail.com> - 2012-12-26 03:27 -0500
      Re: JScrollpane calors "John B. Matthews" <nospam@nospam.invalid> - 2012-12-26 11:27 -0500
        Re: JScrollpane calors emf <emfril@gmail.com> - 2012-12-26 21:27 -0500
          Re: JScrollpane calors "John B. Matthews" <nospam@nospam.invalid> - 2012-12-27 09:32 -0500
  Re: JScrollpane calors Roedy Green <see_website@mindprod.com.invalid> - 2012-12-29 09:50 -0800
    Re: JScrollpane calors "John B. Matthews" <nospam@nospam.invalid> - 2012-12-29 15:52 -0500

csiph-web