• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using NullLayout for GUI development

 
Tarun Sukhani
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any restrictions by Sun in using
NullLayout as the layout for GUI development?
I'm really lazy and wanted to develop a
wizard dialog this way since it's not resizable
anyway.
 
Gregory Garrison
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't suggest it. The purpose of the exam is to demonstrate some knowledge. It will appear as if you don't know how to use a layout.
 
Tarun Sukhani
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Man, why can't Sun let me be lazy and just plop components using an IDE? Client side programming sucks!
Originally posted by Gregory Garrison:
Wouldn't suggest it. The purpose of the exam is to demonstrate some knowledge. It will appear as if you don't know how to use a layout.
 
Dalton Filho
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having this problem. I did use layout managers on my main window, but I don't see why is it better to not use a null layout for a tiny, not resizable dialog.

Considering the cost/benefit, it looks better and it's less costly (I could almost use JOptionPane).

Did anyone use null layouts for anything here?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NEVER use NullLayout. It's inconsistent across platforms for one thing, and as said just shouts "I used an IDE because I couldn't be bothered to learn how to do it myself".

For dialog boxes, JOptionPane can be an excellent choice, if it can do what you need it to.
 
Luiz Reginaldo Curado
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Use the NullLayout in NetBeans and change it to GridBag. I think it's a good idea.
 
Jason Moors
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my assignment I've got the following requirement (see below) and I don't think using the NullLayout meets this requirement, plus it doesn't take a genius to notice code that has been generated which would be an instant failure.

Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs.


regards
Jason
 
Dalton Filho
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm now using GridBagHell for the search dialog... I hope they like it... :roll:
 
Nick Kerr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I were you, I would avoid using GridBag. The code of the gridbag layout manager is the hardest to read and maintain. If you MUST use gridbag, make sure you understand and document all of the code otherwise you are likely to lose points here.

I'd recommend that you read up on FlowLayout, BorderLayout and BoxLayout. You can build just about anything by combining these layout managers.

Nick
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And GridLayout, which can be handy for grouping dialogs nicely with all the elements lined up in columns.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic