Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: programming style

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Thanked 0 Times in 0 Posts

    Default programming style

    Hi, guys. I'm very new to programming and i would like to know something. Am doing a program that changes screens depending on the button you click. Should i make every screen a class extending JPanel and create and add all the components that belong there, or should I stay with one JPanel and hide the components and show new ones to make an illusion that the screen changed, or should I do it all in the same class. ?Thank you.

  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    My Mood
    Thanked 263 Times in 232 Posts

    Default Re: programming style

    Welcome Jason00

    Please read: Thread: This Forum is for Saying Hi, not for Asking Technical Questions (READ BEFORE POSTING)

    Why would you decide to make every screen a class? How are the screens related and how are they different? Draw out the relationship among them to get an idea.
    Why would you decide to make just one JPanel and hide components? How many components would you have to hide? How hard would that be to maintain in comparison?
    Why would you decide to make just one class? What is the goal of the program? Does the solution to the problem suggest more than one class?

    Ask yourself a bunch of questions until one choice is a sure win.
    If no choice becomes a sure win, pick the one you think is pretty.

Similar Threads

  1. Seeking help with minesweeper style program.
    By Gravs2889 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: February 25th, 2012, 11:28 PM
  2. Moving through frames via buttons in the style of a menu
    By philgrek in forum AWT / Java Swing
    Replies: 1
    Last Post: December 5th, 2011, 12:06 AM
  3. NetBeans-style GUI
    By susieferrari in forum Java Theory & Questions
    Replies: 7
    Last Post: March 31st, 2011, 09:40 AM
  4. Noob that needs some clearing up with Java style programming
    By looneylu in forum Java Theory & Questions
    Replies: 3
    Last Post: January 23rd, 2011, 11:27 PM
  5. Trying to achieve Movie Style Rolling Credits
    By javanoob123 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 10th, 2011, 08:02 PM

Tags for this Thread