I created an applet that extends JApplet. The applet paints a square with the upper left hand corner at 10,10, and is 40 pixels across. I want to create a button that goes inside the square, like b.setBounds( 20 , 20 , 20 , 20 ), but is not visible. When you click inside the square (the button), the square changes colors (I have a Color array that it cycles through). Problem is, if I do a setVisible( false ), the button is hidden, but it does not function. When I set it to true, the button takes up the whole applet content pane. Any suggestions? Thanks! Jason
posted 15 years ago
Hi Jason, Try setting your JApplet layout to null. This should stop the button from taking up the entire applet. Regards, Manfred.