Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: emf Newsgroups: comp.lang.java.help Subject: Re: JScrollpane calors Date: Wed, 26 Dec 2012 03:27:57 -0500 Organization: Aioe.org NNTP Server Lines: 39 Message-ID: References: NNTP-Posting-Host: +mrIWWeti6H3gXnn8iWLFw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.help:2388 On 2012-12-25 23:34 John B. Matthews wrote: > In article , emf > wrote: > >> I have made a JTextArea with a JScrollpane. The colors are dark, so I >> want the scroller to have a darker color then the default. I tried >> >> scroller.setForeground(Color.GRAY); >> scroller.setBackground(Color.BLUE); >> >> but they do not have any effect. Why? > > The rendering is handled by the component's UI delegate, often an > instance of a class derived from BasicScrollBarUI. 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", ...); I deleted the scroller.setForeground(...) and scroller.setBackground(...) statements, since they did not have any effect, and added your statements before JScrollPane scroller = new JScrollPane(... 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? 1/2 Thanks, Eustace -- Date Calculator with all-purpose JS code https://files.nyu.edu/emf202/public/js/dateCalculator.html