Reputation: 135
I have a Java project which has a functional JMenu. I'm trying to add a toolbar to it but it doesn't appear. I do get something I can drag which creates a blank window if I click around just under the menu bar.
protected JToolBar createToolBar(){
JToolBar t1;
t1 = new JToolBar();
JButton test;
test = new JButton("text here");
t1.add(test);
return new JToolBar();
}
This code might also be relevant.
protected Container createContentPane(){
// Create the content-pane
JPanel contentPane = new JPanel(new BorderLayout());
contentPane.setOpaque(true);
// Create the toolbar
JToolBar jt = createToolBar();
contentPane.add(jt, BorderLayout.PAGE_START);
return contentPane;
}
I would appreciate any help.
Upvotes: 0
Views: 124