• Post Reply Bookmark Topic Watch Topic
  • New Topic

setPreferredSize trouble

 
Valery Lezhebokov
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

API docs contain following description of setPreferredSize() function:

setPreferredSize
public void setPreferredSize(Dimension preferredSize)Sets the preferred size of this component. If preferredSize is null, the UI will be asked for the preferred size.

So, when I execute this code:

everything is OK. But regarding this one:

the result is quite opposite. I don't see jLabel on the frame.
What's wrong?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT.
 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When executed, I got the same result in both cases. I think, you might have changed some other part of the program. Try once again by changing just the three lines which you mentioned
 
Valery Lezhebokov
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx, I'll try.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!