左上隅にあるはずだった 2 つの JPanel がありますが、何らかの理由でそれらは y 軸の途中にあります (ただし、まだ残っているため、x 軸は 0 です)。とにかくここにコードを投稿します。その方が私の問題を理解しやすいと思います。助けてくれてありがとう。
JFrame scrabbleBoard = new JFrame();
scrabbleBoard.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container topPane = scrabbleBoard.getContentPane();
topPane.setLayout(new BoxLayout(topPane, BoxLayout.X_AXIS));
JButton done = new JButton ("Done");
JLabel player1 = new JLabel ("Player 1");
topPane.add(player1);
topPane.add(done);
scrabbleBoard.pack();
scrabbleBoard.setVisible(true);