Solved

Windows-style button

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
network + 7 73
parentbit challenge 3 51
JUnit 4 @Before and @BeforeClass differences 3 19
Java - Why doesn't this JFrame work 3 15
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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…

707 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

14 Experts available now in Live!

Get 1:1 Help Now