Hello guys, i have problebs adding a toolbar to my main jframe and i want you to help me. The code is as follows:
import java.io.*;
import javax.swing.*;
import javax.swing.JToolBar;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.border.*;
import javax.swing.Timer;
//import javax.swing.util.*;
//import javax.swing.JPasswordField;
public class UIJBHotelMainGui extends JFrame
{
//ATTRIBUTES
private JButton checkInJButton,checkOutJButton,bookingJButton,view JButton,managementJButton,securityJButton,reportJB utton,logoutJButton;
private Container container;
public UIJBHotelMainGui()
{
super("UIJBHotel");
MainWindowGui();
}
public void MainWindowGui()
{
//Long startTime = System.currentTimeMillis();
JFrame mainFrame = new JFrame("uijbHotel");
mainFrame.setSize(500,400);
mainFrame.setLocation(100,50);
mainFrame.setVisible(true);
JMenuBar mainMenuBar = new JMenuBar();
mainFrame.setJMenuBar(mainMenuBar);
JMenu fileMenu = new JMenu("File");
JMenu helpMenu = new JMenu("Help");
mainMenuBar.add(fileMenu);
mainMenuBar.add(helpMenu);
fileMenu.add(new JMenuItem("Check In"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("Check Out"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("View"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("Bookin"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("Management"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("Security"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("Report"));
fileMenu.addSeparator();
fileMenu.add(new JMenuItem("Logout"));
fileMenu.addSeparator();
helpMenu.add(new JMenuItem("View Help"));
helpMenu.addSeparator();
helpMenu.add(new JMenuItem("About"));
}//end of mainwindowfui
public static void main (String args[])
{
UIJBHotelMainGui ustaz = new UIJBHotelMainGui();
ustaz.setDefaultCloseOperation(EXIT_ON_CLOSE);
}//end of main
}//end of class UIJBHotelMainGui