0

I've got a little problem. I am trying to do a simple Java2D Game with friends. My work is to do a drawing a game on the JPanel.

There is:

abstract class GameBase

with the simple logic of game, which I have to extends.

Then I need another class extends JPanel implements ActionListener

to draw on it and get actions from the player.

How to contains all of it in one class? I hope you will understand what I want to do :)

Thank's

Andrew
  • 131
  • 1
  • 12
  • possible duplicate of [Java Multiple Inheritance](http://stackoverflow.com/questions/21824402/java-multiple-inheritance) – Emile Pels Jan 14 '15 at 13:16

1 Answers1

0

I think it's possible to bind or connect your classes with references together. For Example:

class firstExampleClass extends firstExtendedClass{

    LogicalExampleClass panelSample;

    public firstExampleClass(){
       //BIND or connect via Relationship

    }
}

class logicalExampleClass extends secondExtendedClass{

}
Lukas Hieronimus Adler
  • 1,063
  • 1
  • 17
  • 44