Solved

Windows-style button

Posted on 2004-10-05
4
210 Views
Last Modified: 2012-05-05
I'm using a JButton with a bevel border and the windows plaf. I'm trying to get a button that looks like the most common kind of windows-style button. The kind that when its clicked it looks like its being pressed down and then it pops back up.

What I'm hoping to see is when I click on the button the color of the upper left and lower right bevels switch, while the face stays the same color and then it switches back.

What I'm getting is that the bevels stay the same color and the face switches, which doesn't look much like anything was pressed.  

I can probably code this behavior myself but I'm guessing that there are just some settings somewhere that I need to use. Or maybe there is already some available button class that does this.

Can someone direct me to a good way to accomplish this?

Thanks!  
0
Comment
Question by:adg
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 125 total points
ID: 12224969
Do you set the windows Look and feel?

        // Set the windows Look & Feel
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch (Exception e) {
        }
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12224980
0
 
LVL 3

Author Comment

by:adg
ID: 12224997
I feel like such an idiot. I could have sworn I was already in the windows look and feel but I guess not cause that worked wonders.  

Thanks!
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12225019
>> I feel like such an idiot.
Just don't do! ;°)

Thanks for accepting.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

861 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now