This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Awt Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Awt Button" Watch "Awt Button" New topic

Awt Button

cinderalla rahul

Joined: Jan 11, 2002
Posts: 9
Hello Friends,
I am using awt button component.
I have to set image for this button,so i tried to paint the image over the button.
it worked.
But i need to change the image like JButton(normal,rollover,selected icon) for this awt using paint by mouse event.
Is this possible & will work fine.If so help me out try this.
Excepting u'r replies,
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You have to make the images yourself, then add a mouselistener and mousemotionlistener to the button that switch the images based on the events recieved by the listeners. This functionality was built into Swing, but you have to do it yourself in AWT.


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Awt Button
It's not a secret anymore!