Solved

Windows-style button

Posted on 2004-10-05
4
214 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

726 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