Results 1 to 7 of 7

Thread: GUI Planning?

  1. #1
    Tombomb is offline Member
    Join Date
    Jan 2012
    Posts
    33
    Rep Power
    0

    Question GUI Planning?

    I was just wondering what the best way, or some ideas for ways, to design a program with multiple pages would be. For example say I want a welcome page that allows the user to create a project. Once the user clicks "Create Project" I want that screen to disappear and a second page to appear with new GUI Components for the user to see. In order to keep organized and have a well designed program, how would one go about this? Would you just create a new .java file for each screen/page? I have tried it all in one file and it just gets clustered beyond belief.

    Any ideas would be appreciated! Thank you!

    - Tombomb

  2. #2
    Tombomb is offline Member
    Join Date
    Jan 2012
    Posts
    33
    Rep Power
    0

    Default Re: GUI Planning?

    Anything? :/

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: GUI Planning?

    Quote Originally Posted by Tombomb View Post
    ...For example say I want a welcome page that allows the user to create a project. Once the user clicks "Create Project" I want that screen to disappear and a second page to appear with new GUI Components for the user to see.
    CardLayout would work well for swapping components dynamically


    In order to keep organized and have a well designed program, how would one go about this? Would you just create a new .java file for each screen/page?
    Yes, this would make the most sense to me.

    Vut having said this, I would recommend that you first work on the non-GUI "brains" part of your code first, the "model" that the GUI is built around since this is ultimately more important than the GUI itself.

  4. #4
    Tombomb is offline Member
    Join Date
    Jan 2012
    Posts
    33
    Rep Power
    0

    Default Re: GUI Planning?

    CardLayout would work well for swapping components dynamically
    I'll look into this for swapping the components out. I was also instructed by a professor that high level GUI's in java used GridBagLayout to place components because you have total control of where they are placed, unlike GridLayout or BorderLayout.

    Yes, this would make the most sense to me.

    Vut having said this, I would recommend that you first work on the non-GUI "brains" part of your code first, the "model" that the GUI is built around since this is ultimately more important than the GUI itself.
    Okay I'll do it that way, and I totally agree. I am re-doing a program I have written most of and I did the GUI at the same time as the Computational Object and its gotten mixed in and very messy.

    Thank you for your response!

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: GUI Planning?

    Quote Originally Posted by Tombomb View Post
    ...I was also instructed by a professor that high level GUI's in java used GridBagLayout to place components because you have total control of where they are placed, unlike GridLayout or BorderLayout.
    With all due regard to your instructor, that statement seems overly simplistic by a long shot. Complex GUI's may use GridBagLayout, but often can obtain the layout desired and in a far easier fashion using nested JPanels, each using a more coder-friendly layout such as GridLayout, BoxLayout, BorderLayout, etc,... and yes sometimes even nested in combination with GridBagLayout.

    Thank you for your response!
    My pleasure!

  6. #6
    Tombomb is offline Member
    Join Date
    Jan 2012
    Posts
    33
    Rep Power
    0

    Default Re: GUI Planning?

    Yeah the way I was doing it before was nesting JPanels like crazy to get stuff where I wanted it lol.... It was kind of annoying actually but I probably didn't design it very well hah :/

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: GUI Planning?

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Planning projects
    By jammas615 in forum Advanced Java
    Replies: 2
    Last Post: 10-08-2011, 03:43 PM
  2. I need help planning.
    By AcousticBruce in forum New To Java
    Replies: 2
    Last Post: 02-26-2011, 04:22 PM
  3. program to assist in planning forms
    By shags_j in forum SWT / JFace
    Replies: 6
    Last Post: 11-02-2009, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •