Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do use null layout is a bad idea?

 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I think that use null layout is a bad idea, but what do you think?

thanks
 
mohamed sulibi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear Leandro;

test it on different resolution setting and also on different machine contain same VM and resize your windows then see your windows if it is nice then go ahead , what you think ?

Best Regards.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohamed sulibi wrote:dear Leandro;

test it on different resolution setting and also on different machine contain same VM and resize your windows then see your windows if it is nice then go ahead , what you think ?

Best Regards.


I'm not talking about it. I'm talking about if the examiners won't like if I use null layout.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe it can be harder to maintain a window with null layouts... even though it may look good, you can lose some points in the UI marking criteria because of that...
 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is not explicitly included in the "instructions.html" so they can not deduct points if you justify in choices.txt
 
Roel De Nijs
Sheriff
Posts: 9780
101
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leandro,

Take a look at this link

A comparison between a null-layout and a FlowLayout. I think (like Roberto said already) you will loose some points for GUI for using it, because it's hard to maintain, more code, less flexible,... Adding an extra button will lead to a lot of recalculation you have to do.

Kind regards,
Roel
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for the explanations!
Roel, nice link, but the example favored FlowLayout. =D
I better comparison would be between null and GridBagLayout.

I found a very funny video about GridBagLayout http://madbean.com/anim/totallygridbag/
And a scare bug about GridBagLayout too ... http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4238932
 
Roel De Nijs
Sheriff
Posts: 9780
101
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leandro

Indeed, that's a really funny video And it has a bit of truth in it: with GBLayout you will end up with more code than null layout (every time setting the GBConstraints). But i think making changes to your form (adding a label, field,...) will be easier and faster though then when you have to recalculate everything.

I used the following layouts for all my panels:
- GridBagLayout
- BorderLayout
- FlowLayout
- BoxLayout (bu this one will be removed in favour of FlowLayout)

Kind regards,
Roel
 
K. Tsang
Bartender
Posts: 3347
12
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GridBag may be powerful but it surely needs whole bunch of constraints which can make "junior" programmers hard to follow. Remember one thing Sun examiners look for is "clarity and maintenability" .... so keep it straightforward.

I don't see why you need to use null layout. For me, I used BorderLayout, FlowLayout, and at times GridLayout throughout my GUI code. As long as you manage to place those components at the right places no fancy or gridbag layouts are needed.
 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I quit! I Was using null Layout too , but then I'll rewrite my gui package... these guys....

See you Later!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic