Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference Between FlowLayout and GridLayout  RSS feed

 
kalai arasan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Could you please any one expain me about difference between GridLayout and FlowLayout?



centerPanel.setLayout(new FlowLayout(FlowLayout.LEFT))

centerPanel.setLayout(new GridLayout(0,6,5,5))


I used 2nd line with GridLayout instead of 1st line's FlowLayout.

Can i use same FlowLayout instead of GridLayout?
Because it does not work some time properly.



With Regards,
Kalai.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learn all about layouts: http://download.oracle.com/javase/tutorial/uiswing/layout/index.html
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kalai arasan wrote:Can i use same FlowLayout instead of GridLayout?

You can use whichever you want, but they do different things. A GridLayout puts all the components in a grid and forces them all to the same size. If that's what you need, you should use it. If it's not....
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is like asking what the difference between an apple and a pear is. Both are fruits, both grow on trees, but that's about it.

Edited stupid typo...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you posted an example of the differences a month ago

http://www.coderanch.com/t/549726/GUI/java/Re-GridLayout-Buttons

have you been asleep?
 
kalai arasan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


It was working fine with GridLayout,
suddenly in production some irrespective responsibility is coming here on this.

thats why i posted.


any way thanks for your comments ,


With Regards,
Kalai.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's "irrespective responsibility"?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!