I need help on something
I'm new here.
I was just wondering if anyone knew how to put buttons overtop of an animated series of images in Java?
I would really apreciate it...
its a JApplet I am working on btw.
Extend a JPanel for drawing. Set its LayoutManager to null. Create your buttons and
issue a setBounds(x,y,width,height) for each of them before your to place them on the excact spot on your panel by a simple thePanel.add(button);
Do all your draiwing by overriding the JPanels paintComponent(Graphics g) method. Don't 'paint' the buttons, they will be placed on top og the drawing after the paintComponent method exits.
Good Luck !
PS: you can animate (move) the buttons by calling the buttons' setBounds and then the panel's validate/repaint method.
Last edited by sjalle; 01-07-2006 at 10:48 AM.
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