Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

AWT Button  without Color ???

Posted on 1997-09-25
3
278 Views
Last Modified: 2006-11-17
I generate a AWT Button and want to change the Color
with, button.setBackground(Color.red) for example,
but the Background of the Button is allways lightGray.
What's  wrong ????
and How can I change the Color of a AWT Button ?
0
Comment
Question by:maiert
3 Comments
 

Author Comment

by:maiert
ID: 1227523
Edited text of question
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1227524
I think that it's bug in JDK 1.02
for win95 (at least I checked it with this release), and
found this problem several months ago too

To make custom looking components
override Canvas.class :(
0
 
LVL 1

Accepted Solution

by:
mnelson051997 earned 100 total points
ID: 1227525
You can't change an AWT Button's color.  Since it is done
with an OS-specific peer, it uses whatever the system thinks
is the correct color for a button.  You would have to make
your own button class - unquestionably a pain.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question