Hi, When you create a JMenu and move a mouse over it, you can see an elevated JMenu. You can also see that in Back/Stop/Forward buttons in IE. Thats the wasy is works for JMenu. But, I also need to generate such an elevated JButton for my desktop application. Regards, Shankar
Shankar Shanmugam<br />Sun Certified Programmer for Java 2 Platform<br />Sun Certified Developer for Java 2 Platform<br />Email: shankar.s@vsnl.net<br /> "Walking on water and building IT Architecture from <br /> specification are easy if and only if both are frozen"<br />-----------------------------------------------
Hi, Set a default border for the desired button, add a mouse listener to it. use the mouse entered and mouse exited property toggle the border property of the button. Try this code
Hi, Thanks for your detailed reply with a neat code. I didn't a try with border. But, I have a problem here. When you have a list of JButton in a sequence and try to do a mouse over. All, the botton's location wud get affected....It willlok like all the JButton's are dancing. There are two methods setRolloverEnabled() setRolloverIcon(). setRolloverEnabled(true) should give our expected effect. But it doesn't work and API also says that it might not work for some platform (UI L&F). I tested it with windows. But, setRolloverIcon() of some Icon is work fine. The icon gets changed. After all, we don't need to capture mouse events for these two methods. Thanks in Advance.
Regards, Shankar
Shankar Shanmugam<br />Sun Certified Programmer for Java 2 Platform<br />Sun Certified Developer for Java 2 Platform<br />Email: shankar.s@vsnl.net<br /> "Walking on water and building IT Architecture from <br /> specification are easy if and only if both are frozen"<br />-----------------------------------------------