• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help  RSS feed

 
richard chuquilin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I want to use flowLayout() method and the setpreferredSize() on my program.
 
Bernhard Goetz
Ranch Hand
Posts: 57
1
Java Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to post a question. Otherwise no one will know what your problem is!
Also: Try to use a title which describes your problem, for example: "FlowLayout and setPreferredSize(..)"
You can use the code tags around your Java source, then everyone will have a better time reading it.

Regards, Bernhard
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Richard,
In future, while posting code, please UseCodeTags I have added them this time for you. As you can see the tags make the code much more easier to read and understand

As Bernhard correctly pointed out, please UseAMeaningfulSubjectLine You can use the button to make the required change

richard chuquilin wrote:Hello, I want to use flowLayout() method and the setpreferredSize() on my program.

flowLayout is not a method. It is a layout. Also it is FlowLayout (notice the upper case F)
You can find out more about the different layout managers, and how to use them here
http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html
http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html

While using setPreferredSize(), you might keep in mind that not all layout managers honor it (e.g. BorderLayout will ignore it)
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:While using setPreferredSize(), you might keep in mind that not all layout managers honor it (e.g. BorderLayout will ignore it)

It's not quite right to say that BorderLayout ignores the preferredSize, as that's used to compute the preferredLayoutSize.

It would be more correct to say that BorderLayout often doesn't display Components at their preferred sizes.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!