Note that there are some explanatory texts on larger screens.

plurals
  1. POJMenuBar is not visible
    primarykey
    data
    text
    <p>I have the following function which sets up the GUI.</p> <pre><code>public void go() { JFrame frame = new JFrame("Simplex RP Client V1.1 Beta"); JPanel mainPanel = new JPanel(); incoming = new JTextArea(15,50); incoming.setLineWrap(true); incoming.setWrapStyleWord(true); incoming.setEditable(false); JScrollPane qScroller = new JScrollPane(incoming); qScroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); qScroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); outgoing = new JTextField(50); // rpMode = new JComboBox("OOC", "IC", "IT", "ME"); charName = new JTextField(30); charName.setText("Character Name"); JButton sendButton = new JButton("Send"); sendButton.addActionListener(new SendButtonListener()); outgoing.addActionListener(new SendButtonListener()); mainPanel.add(qScroller); mainPanel.add(outgoing); mainPanel.add(sendButton); mainPanel.add(BorderLayout.SOUTH, charName); // setUpNetworking(); Thread readerThread = new Thread(new IncomingReader()); readerThread.start(); JMenuBar menubar = new JMenuBar(); frame.setJMenuBar(menubar); JMenu file = new JMenu("File"); JMenuItem connect = new JMenuItem("Connect"); file.add(connect); frame.getContentPane().add(BorderLayout.NORTH, menubar); frame.getContentPane().add(BorderLayout.CENTER, mainPanel); frame.setSize(577,375); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } // close go </code></pre> <p>I can't seem to get my JMenuBar to show up. I've been trying to fix it for a few hours now, I'm new to Java. Any help would be much appreciated. I don't really have a whole lot to say, I'm sure it's a simple problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload