-
JButton 3d effect
Hi, somebody knows how to make JButtons show flat, and then become 3d when the mouse is over them?
-
The JButton inherits the mouse events and listener methods of java.awt.Component and javax.swing.JComponent. So - create a mouse listener which listens to mouse events in relation to the JButton of interest One of the mouse events which are available is entering (MOUSE_ENTERED) or leaving (MOUSE_EXITED) an unobscured portion of your component. Upon these events you can trigger a change in the appearance of your JButton.
-
cheers man!
Going to give it a try.
-
I have been trying to add this mouse listener. Is there any property of JButton in order to make it 3d or 2d? I have been searching in java docs, but didnt find anything. Thanks!
-
Swing does not provide 3D functionality internally.
Take a look at http://code.j3d.org/ for information about a 3D graphics library.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks