jjzjj

setContentPane

全部标签

JAVA:填充框架的方法。添加(), setContentPane(), getContentPane()

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