3 Attachment(s)
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.
Attachment 1054
Everything inside a JFrame
The JFrame will be split into 2 JPanels.
The only other objects will be mini JPanels I will call Pieces.
Attachment 1055
These Pieces are mouse drag and drop-able between JPanels
Attachment 1056
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
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.
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