• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SetLayout to null for GUI is OK ??

 
Alan A Smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my design, when start the application, a dialog will prompt for user to select the connection type(local or remote). The dialog is fixed size, I want to setLayoutManagement to this dialog to null. Do U think it's not good and deducted some marks ?
Thx a lot.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alan, welcome to JavaRanch.
The reason for layout managers is that it provides an object oriented way of laying out components that works regardless of operating system.
The bad things about setting layout manager to null and manually placing each component are that:
  • Adding or moving a component becomes very labour intensive - if you add a row, all components under that row have to manually moved down a row.
  • The same screen displayed on different operating systems can look wrong: If you design using a screen with standard components that take up 12 pixels, and move to a screen with standard components that take up 16 pixels, then your components may overlap. Conversely, if you design on a screen with standard components that take up 16 pixels and move to a screen with standard components that take up 12 pixels, then your components may move too far apart.


  • My instructions mention that:
    Your user interface should be designed with the expectation of future functionality enhancements
    I think that the first point I mentioned above would fail to meet this requirement.
    A further requirement is:
    layout uses good/accepted Human/Computer Interaction (HCI) principals
    . This is worth 16% of the whole assignment! If the examiner starts your application on the wrong hardware (or even just notices that it might cause problems) you could loose significant points here.
    So, no - even though it is not specifically disallowed, I think there is too much risk of it costing you marks.
    Regards, Andrew
     
    Alan A Smith
    Greenhorn
    Posts: 21
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Andrew,
    Thanks a lot, your comment is really helpful for me. I will redesign my application to using a Layout manager.

    Regards,
    Alan
     
    Barry Gaunt
    Ranch Hand
    Posts: 7729
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello Alan, great to have you on the JavaRanch.
    But (there's always a but) you are going to have to change your name according to the naming policy. Thanks in advance
    -Barry
     
    Francis Siu
    Ranch Hand
    Posts: 867
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    hi Alan
    SetLayout to null for GUI is OK ??
    Yes, but you need to
    setBounds(int corrX,int corrY,int width,int height);
    which needed to set the dialog where to appear and the size of it.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic