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


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

JScrollpane calors

From emf <emfril@gmail.com>
Newsgroups comp.lang.java.help
Subject JScrollpane calors
Date 2012-12-25 21:52 -0500
Organization Aioe.org NNTP Server
Message-ID <kbdofo$lr8$1@speranza.aioe.org> (permalink)

Show all headers | View raw


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 code is:

	outputArea = new JTextArea("", 19, 37);
	outputArea.setForeground(Color.WHITE);
	outputArea.setBackground(Color.BLACK);
	outputArea.setFont(textFont);
	outputArea.setEditable(false);
	outputPanel.add(resultsArea);

	JScrollPane scroller = new JScrollPane(resultsArea,
		JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
		JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
	scroller.setForeground(Color.GRAY);
	scroller.setBackground(Color.BLUE);
	outputPanel.add(scroller);

Thanks.

Eustace

-- 
It ain't THAT, babe! - A radical reinterpretation
https://files.nyu.edu/emf202/public/bd/itaintmebabe.html

Back to comp.lang.java.help | Previous | NextNext 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