Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] awt containers

Started by CProgrammer Apr 30, 2004 at 4:14 AM 4 replies 650+ views
Original Post
CProgrammer
CProgrammer
There driving me nuts. Is there some way to specify exact Positions for my Buttons, Textfields... -CProgrammer
Optus
Optus
Yes the AP is right on here.
Pseudo-code

container.setLayout(null);
container.getContentPane().add(button);
button.setBounds(x,y,width,height);
Koroljov
Koroljov
If it''s an AWT container (java.awt.Container), you don''t use getContentPane()

theContainer.setLayout(null);
theButton.setBounds(x1,y1,width,height);
theContainer.add(theButton);
Why do my programs never work on other computers?
Optus
Optus
Indeed, thanks for the correction.
CProgrammer
CProgrammer
Right, that does it.
Thanks guys.
-CProgrammer

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.