我找到了三种方法来填充我的JFrameframe=newJFrame("...")createContentPanel返回一个JPanel,createToolBar返回一个ToolBar。frame.add(this.createToolBar(),BorderLayout.PAGE_START);//thisworksandputstheToolBaraboveandtheContentPanelunderitframe.add(this.createContentPanel(),BorderLayout.CENTER);frame.setContentPane(this.crea