0
我寫的代碼不顯示菜單欄,有什麼想法我該怎麼辦?看不到菜單欄
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//What happens on close.
this.setSize(1100, 750);//Initial size of the frame.
menuBar = new MenuBar();
east = new EastPanel();
central = new CentralPanel();
south = new SouthPanel();
//Add the menu bar to the frame.
this.setJMenuBar(menuBar.getComposition());
//Frame's other components.
this.add(central.getCentralPanel());
//this.add(msBoard.getMessagesBoard(), BorderLayout.SOUTH);
this.add(east.getEastPanel(), BorderLayout.EAST);
this.add(south.getSouthPanel(), BorderLayout.SOUTH);
//this.add(menuBar);
//Load the card images.
//cards = new CardImages();
//cards.loadCards();
//Initialize cardsPerPlayer list.
//cardsPerPlayer = new ArrayList<ImagePanel>();
this.setVisible(true);
其中getComposition是
public JMenuBar getComposition(){
return this.Composition;
}
和寫作是私人的JMenuBar