Java, BorderLayout.CENTER, getting the width and height of the JPanel
问题 I am using Swing and AWT (for the listeners) to make a small program. I have a problem concerning getting the size of my JPanel (the class named Chess). My Layout: public class Main extends JFrame implements MouseListener, ActionListener{ Chess chessPanel = new Chess (); JButton newGameButton = new JButton ("New Game"); JButton loadGameButton = new JButton ("Load Game"); JButton saveGameButton = new JButton ("Save Game"); JButton exitButton = new JButton ("Exit"); public static void main