• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can not set the stupid size to panel here is the problem!

 
zick
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why I can in applet when i set size with (p -> is my panel) p.setSize(100,100); is not seting the size? I just getting the constant size difined by Gridlayou(3,2)?
--------------
* - - -
--------------
- - -

* is my painted in blue area on applet
Please help me i posted the question already today but from some reasonse no body had responsed me yet
Thanks for help
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"zick",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using GridLayout( or any other layout for that matter ), the layout manager always sets the size, so calls to setSize() don't work... If you want resizing to work, do setLayout( null ) in the init() method of your Applet... but be prepared to do a setBounds( x, y, w, h ) for every component you add to your Applet...

HTH,
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic