-
JButton in JApplet
i'm trying to add a JButton to my JApplet.
the JButton should be set to an absolute position, but it doesn't appear on the JApplet.
here's my code:
Code:
this.setSize(740,780);
this.setLayout(null);
JButton button = new JButton("New Game");
this.add(button);
button.move(720-button.getSize().width, 760);
how can i fix this?
-
Re: JButton in JApplet
ok. i did some research + it looks like i could use GridBagLayout.
can anyone show an example of this?
-
Re: JButton in JApplet
Your research should also point you to the layout manager tutorials which will be able to show you GridBagLayout and the other layouts far better than we possibly can. Why not give this a look and then come on back if you're still stuck.
-
Re: JButton in JApplet
i used an absolute position. i'd forgotten setSize + setVisible