Solved

Windows-style button

Posted on 2004-10-05
4
215 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
[X]
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
  • 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 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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

705 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