0
マイメニューバーが表示されません。 GUIに表示するにはJPanelが必要ですか?メニューバーGUIアプリケーション
private void buildCtrlPanel() {
ctrlPanel = new JPanel();
menuBar = new JMenuBar();
fileMenu = new JMenu("File");
optionsMenu = new JMenu("Options");
JFrame frame = new JFrame();
frame.setJMenuBar(menuBar);
frame.setSize(350, 250);
frame.setVisible(true);
ctrlPanel.setLayout(new FlowLayout());
ctrlPanel.add(menuBar);
ctrlPanel.add(frame);
menuBar.add(fileMenu);
menuBar.add(optionsMenu);
}