• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Do use null layout is a bad idea?

 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! I think that use null layout is a bad idea, but what do you think?

thanks
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 80
BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
reply
    Bookmark Topic Watch Topic
  • New Topic