First of all your program is giving compilation errors. Fix them. You have to extend SplitTableHand
with JPanel
. With this your error in GamePanel
gets resolved.
public class SplitTableHand extends JPanel
Second point is in GamePanel
class constructor, you created topPanel
and added it to the frame instead of adding secondSplit
.
Change the constructor of GamePanel
to
public GamePanel() {
secondSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,splitTableHand, chatPanel);
secondSplit.setOneTouchExpandable(true);
secondSplit.setDividerLocation(150);
this.setSize(1280, 720);
this.setResizable(false);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
//this.pack();
this.setVisible( true );
getContentPane().add( secondSplit );
}
In SplitTableHand
class also, you have to add the splitPane
.
Add a statement in it's constructor add(splitPane);