January 29th, 2010, 08:57 PM
ok so i am trying to create a program but when i try set its bounds, i always get a small box each time...
am i doing something wrong, i have tried many different numbers for the bounds and it just doesn't want to work. What is a good size text area?
JTextField ip = new JTextField();
JLabel ipAdd = new JLabel("Internet Protocal");
January 30th, 2010, 06:34 AM
Re: JTextField setBounds
Setting the bounds relocates and resizes the component in the absence of any layout managers. If you are using a layout manager (which you will be unless you explicitly set it null), you'll find that only max, min, and preferred size are respected - otherwise the layout manager couldn't do its job. I would suggest setting the preferred size to the size you want and letting the layout manager handle the positioning. See Laying Out Components Within a Container.
Originally Posted by Alexz003
That depends what you want to use it for, and the design of your application.
What is a good size text area?
Thatís whatís cool about working with computers. They donít argue, they remember everything, and they donít drink all your beer...
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!