The Artima Developer Community
Sponsored Link

Java Answers Forum
Changing the pressed jbutton color?

1 reply on 1 page. Most recent reply: May 14, 2002 4:29 AM by locutus

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Stefan Parijs

Posts: 16
Nickname: stefan
Registered: May, 2002

Changing the pressed jbutton color? Posted: May 14, 2002 1:51 AM
Reply to this message Reply
Advertisement
How can you change the backgroundcolor of a JButton, which is pressed.

Tnx on advance

Stefan Parijs

parijs_Stefan@yahoo.Com


locutus

Posts: 6
Nickname: locutus
Registered: May, 2002

Re: Changing the pressed jbutton color? Posted: May 14, 2002 4:29 AM
Reply to this message Reply
hiho,

for example:

button1.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{

//change of color
button1.setBackground(Color.green);

//further actions
...
}
});

Flat View: This topic has 1 reply on 1 page
Topic: J2EE Previous Topic   Next Topic Topic: easy question,please help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use