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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 3 of 3

Thread: FREE HELP WANTED: Setting up Class structure for Gui(JFrame) project.

  1. #1
    Member
    Join Date
    Feb 2012
    Posts
    106
    My Mood
    Yeehaw
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Default FREE HELP WANTED: Setting up Class structure for Gui(JFrame) project.

    I have decided to convert to a cleaner programming style, (code re-usability)
    Thus, I am relearning class structure and inheritance/polymorphism and all the great protection and clarity they provide

    My program in many ways will be like a chess game program.
    Opening.JPG

    Everything inside a JFrame
    The JFrame will be split into 2 JPanels.
    The only other objects will be mini JPanels I will call Pieces.
    DescribingParts.JPG

    These Pieces are mouse drag and drop-able between JPanels
    DescribingInteraction.JPG

    Breaking bad habits begins here.
    I will have a Pieces Class.
    Pieces will be a parent Class to two children Classes that extend it. (names not important yet)
    I will be making a "Movable Class"
    Movable Class will handle the graphics and mobility of my "mini panels"
    Movables will be an Interface and Pieces will use this Interface.


    Skeleton code of how this all looks would be an amazing and appreciated gift!

    Things I think I know.
    child1 extends Pieces and child2 extends Pieces
    Pieces Implements Movable ?

    then this will force Pieces and all children of Pieces to have the methods from Movable correct?

    Hope I am correct so far,

    The next part gets more confusing for me, mostly because I am very new to GUI's
    I am assuming I have another class which will probably use the program name
    "BattleGrid" BattleGrid will have the main method, as well as most of the GUI framework? (calling, creating, and storing Pieces as needed) please set me strait here.

    Thanks a lot for any involvement!
    Jonathan


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: FREE HELP WANTED: Setting up Class structure for Gui(JFrame) project.

    Well, i've seen the other problem too but both seem similar. Anyways, i've edited it.
    Last edited by Mr.777; February 21st, 2012 at 04:20 AM.

  3. #3
    Member
    Join Date
    Feb 2012
    Posts
    106
    My Mood
    Yeehaw
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Default Re: FREE HELP WANTED: Setting up Class structure for Gui(JFrame) project.

    Its not actually a duplicate post. I broke down my questions into two types of help and posted them in the proper categories. The project is the same so some content is duplicated. If what I was allowable can you remove your duplicate post warning, as I fear it will send away possible helpers.

    Thanks,
    Jonathan

Similar Threads

  1. Java Class (C++ Structure Like) Help
    By Khadafi in forum Java Theory & Questions
    Replies: 6
    Last Post: January 13th, 2012, 09:07 PM
  2. Setting up Directory Structure in Java Applications
    By Jyotirmoy in forum Member Introductions
    Replies: 0
    Last Post: July 28th, 2011, 05:28 AM
  3. Jframe title setting question
    By derekxec in forum AWT / Java Swing
    Replies: 5
    Last Post: June 16th, 2011, 08:01 AM
  4. Setting JFrame maximum size that pack() can not violate
    By Javabeginner in forum AWT / Java Swing
    Replies: 3
    Last Post: September 3rd, 2010, 05:53 AM
  5. Setting JFrame to be only selectable window
    By aussiemcgr in forum AWT / Java Swing
    Replies: 3
    Last Post: July 22nd, 2010, 12:43 PM