Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import BusStationFinal.logic.*;
- import java.awt.BorderLayout;
- import java.awt.EventQueue;
- import javax.swing.DefaultListModel;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.GroupLayout;
- import javax.swing.GroupLayout.Alignment;
- import javax.swing.JLayeredPane;
- import java.awt.CardLayout;
- import javax.swing.JMenuBar;
- import javax.swing.JMenu;
- import java.awt.Toolkit;
- import javax.swing.JLabel;
- import javax.swing.ImageIcon;
- import javax.swing.JCheckBox;
- import javax.swing.JDialog;
- import javax.swing.LayoutStyle.ComponentPlacement;
- import javax.swing.SwingConstants;
- import javax.lang.model.element.Element;
- import javax.swing.ButtonGroup;
- import javax.swing.JTextField;
- import javax.swing.JPasswordField;
- import javax.swing.JButton;
- import java.awt.Font;
- import java.awt.event.ActionListener;
- import java.util.ArrayList;
- import java.awt.event.ActionEvent;
- import javax.swing.JMenuItem;
- import javax.swing.JOptionPane;
- import javax.swing.JScrollPane;
- import javax.swing.JList;
- import javax.swing.border.TitledBorder;
- import javax.swing.UIManager;
- import java.awt.Color;
- public class MainFrame extends JFrame {
- private JPanel contentPane;
- private final ButtonGroup buttonGroup = new ButtonGroup();
- private JTextField textField;
- private JPasswordField passwordField;
- private JPanel MainPanel;
- private JPanel PassengerPanel;
- private JPanel DriverPanel;
- private JPanel ManagerPanel;
- private boolean isPassenger = false , isManager = false , isDriver = false;
- Main fess = new Main();
- private JPanel viewListPanel;
- private JLabel lblSelect;
- DefaultListModel<Trip> listModel = new DefaultListModel<Trip>();
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- MainFrame frame = new MainFrame();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- public void switchScenes(JLayeredPane layeredPane, JPanel panel)
- {
- layeredPane.removeAll();
- layeredPane.add(panel);
- layeredPane.repaint();
- layeredPane.revalidate();
- }
- public DefaultListModel<Trip> updateListModel(ArrayList<Trip> tripList)
- {
- DefaultListModel<Trip> updatedModel = new DefaultListModel<Trip>();
- updatedModel.clear();
- while(!tripList.isEmpty())
- {
- }
- return updatedModel;
- }
- /**
- * Create the frame.
- */
- public MainFrame() {
- setResizable(false);
- setIconImage(Toolkit.getDefaultToolkit().getImage(MainFrame.class.getResource("/BusStationFinal/resorces/bus.png")));
- setTitle("Bus Station DEMO");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 985, 819);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- JLayeredPane layeredPane = new JLayeredPane();
- layeredPane.setBounds(0, 29, 979, 734);
- contentPane.add(layeredPane);
- layeredPane.setLayout(new CardLayout(0, 0));
- MainPanel = new JPanel();
- layeredPane.add(MainPanel, "name_138950836708208");
- JLabel imageBus = new JLabel("");
- imageBus.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/bus-side-view.png")));
- JCheckBox chckbxPassenger = new JCheckBox("Passenger");
- chckbxPassenger.setFont(new Font("Tahoma", Font.PLAIN, 20));
- chckbxPassenger.setSelected(true);
- buttonGroup.add(chckbxPassenger);
- JCheckBox chckbxDriver = new JCheckBox("Driver");
- chckbxDriver.setFont(new Font("Tahoma", Font.PLAIN, 20));
- buttonGroup.add(chckbxDriver);
- JCheckBox chckbxManager = new JCheckBox("Manager");
- chckbxManager.setFont(new Font("Tahoma", Font.PLAIN, 20));
- buttonGroup.add(chckbxManager);
- JLabel lblusername = new JLabel("USERNAME :");
- lblusername.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JLabel lblpassword = new JLabel("PASSWORD :");
- lblpassword.setFont(new Font("Tahoma", Font.PLAIN, 20));
- textField = new JTextField();
- textField.setFont(new Font("Tahoma", Font.PLAIN, 20));
- textField.setColumns(10);
- passwordField = new JPasswordField();
- passwordField.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnlogin = new JButton("LOGIN");
- btnlogin.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if((textField.getText().isEmpty()||passwordField.getText().isEmpty() )) {
- JOptionPane.showMessageDialog(null,"ERROR,ENTER YOUR USER NAME AND PASSWORD");System.out.println(textField.getText());}
- else if(chckbxPassenger.isSelected())
- {
- if(fess.check(textField.getText(), String.valueOf(passwordField.getPassword())))//Authenticate passenger
- {
- JOptionPane.showMessageDialog(null,"WELCOME HOME:)");
- isPassenger = true;
- switchScenes(layeredPane, PassengerPanel);
- textField.setText("");
- passwordField.setText("");
- }
- else
- JOptionPane.showMessageDialog(null,"INVALID USER NAME OR PASSWORD!");
- }
- else if(chckbxDriver.isSelected())
- {
- if(true)//Authenticate driver
- {
- JOptionPane.showMessageDialog(null,"WELCOME HOME:)");
- isDriver = true;
- switchScenes(layeredPane, DriverPanel);
- textField.setText("");
- passwordField.setText("");
- }
- else
- JOptionPane.showMessageDialog(null,"INVALID USER NAME OR PASSWORD!");
- }
- else
- {
- if(true)//Authenticate manager
- {
- JOptionPane.showMessageDialog(null,"WELCOME HOME:)");
- isManager = true;
- switchScenes(layeredPane, ManagerPanel);
- textField.setText("");
- passwordField.setText("");
- }
- else
- JOptionPane.showMessageDialog(null,"INVALID USER NAME OR PASSWORD!");
- }
- }
- });
- btnlogin.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/login_16.png")));
- btnlogin.setFont(new Font("Tahoma", Font.PLAIN, 20));
- GroupLayout gl_MainPanel = new GroupLayout(MainPanel);
- gl_MainPanel.setHorizontalGroup(
- gl_MainPanel.createParallelGroup(Alignment.TRAILING)
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGap(353)
- .addComponent(imageBus, GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE))
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGap(148)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addComponent(chckbxPassenger)
- .addPreferredGap(ComponentPlacement.RELATED, 193, Short.MAX_VALUE)
- .addComponent(chckbxDriver)
- .addGap(136))
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.TRAILING)
- .addComponent(lblusername)
- .addComponent(lblpassword))
- .addGap(18)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.LEADING)
- .addComponent(passwordField, GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
- .addComponent(textField, 393, 393, 393))))))
- .addGap(48)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.TRAILING)
- .addComponent(chckbxManager)
- .addComponent(btnlogin))
- .addGap(141))
- );
- gl_MainPanel.setVerticalGroup(
- gl_MainPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGap(63)
- .addComponent(imageBus, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
- .addGap(82)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.LEADING)
- .addComponent(chckbxManager)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.BASELINE)
- .addComponent(chckbxDriver)
- .addComponent(chckbxPassenger)))
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGap(112)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.BASELINE)
- .addComponent(lblusername)
- .addComponent(textField, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE))
- .addGap(28)
- .addGroup(gl_MainPanel.createParallelGroup(Alignment.BASELINE)
- .addComponent(passwordField, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
- .addComponent(lblpassword)))
- .addGroup(gl_MainPanel.createSequentialGroup()
- .addGap(148)
- .addComponent(btnlogin, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(152, Short.MAX_VALUE))
- );
- MainPanel.setLayout(gl_MainPanel);
- PassengerPanel = new JPanel();
- layeredPane.add(PassengerPanel, "name_138953435671015");
- JButton btnBookTrip = new JButton("Book Trip");
- btnBookTrip.setFont(new Font("Tahoma", Font.PLAIN, 20));
- btnBookTrip.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- switchScenes(layeredPane, viewListPanel);
- /////////////////////////////////////////////////////////////////////////
- }
- });
- JLabel label = new JLabel("");
- label.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/traffic-sign_256.png")));
- JButton btnBuyBookedTrip = new JButton("Buy Ticket");
- btnBuyBookedTrip.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnViewBookedTrips = new JButton("View Booked Trips");
- btnViewBookedTrips.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnViewAllTripsPassenger = new JButton("View All Trips");
- btnViewAllTripsPassenger.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- lblSelect.setVisible(false);
- switchScenes(layeredPane, viewListPanel);
- }
- });
- btnViewAllTripsPassenger.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnCancelBookedTrip = new JButton("Cancel Booked Trip");
- btnCancelBookedTrip.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JLabel previewPassengerNamelbl = new JLabel("New label");
- JButton btnPassengerLogout = new JButton("LOGOUT");
- btnPassengerLogout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if (JOptionPane.showConfirmDialog(null,"ARE YOU SURE YOU WANT TO LOGOUT?") == JOptionPane.YES_OPTION) {
- switchScenes(layeredPane, MainPanel);
- }
- }
- });
- btnPassengerLogout.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/logout_16.png")));
- btnPassengerLogout.setFont(new Font("Tahoma", Font.PLAIN, 20));
- GroupLayout gl_PassengerPanel = new GroupLayout(PassengerPanel);
- gl_PassengerPanel.setHorizontalGroup(
- gl_PassengerPanel.createParallelGroup(Alignment.TRAILING)
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addGap(361)
- .addComponent(label, GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)
- .addPreferredGap(ComponentPlacement.RELATED, 215, Short.MAX_VALUE)
- .addGroup(gl_PassengerPanel.createParallelGroup(Alignment.LEADING)
- .addComponent(previewPassengerNamelbl)
- .addComponent(btnPassengerLogout))
- .addGap(35))
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addGap(213)
- .addGroup(gl_PassengerPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addComponent(btnViewAllTripsPassenger)
- .addPreferredGap(ComponentPlacement.RELATED, 227, Short.MAX_VALUE)
- .addComponent(btnCancelBookedTrip))
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addComponent(btnBuyBookedTrip)
- .addPreferredGap(ComponentPlacement.RELATED, 263, Short.MAX_VALUE)
- .addComponent(btnViewBookedTrips)))
- .addGap(181))
- .addGroup(Alignment.LEADING, gl_PassengerPanel.createSequentialGroup()
- .addGap(422)
- .addComponent(btnBookTrip)
- .addContainerGap(440, Short.MAX_VALUE))
- );
- gl_PassengerPanel.setVerticalGroup(
- gl_PassengerPanel.createParallelGroup(Alignment.TRAILING)
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addGap(26)
- .addComponent(previewPassengerNamelbl)
- .addGroup(gl_PassengerPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addGap(7)
- .addComponent(label, GroupLayout.PREFERRED_SIZE, 205, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
- .addGroup(gl_PassengerPanel.createParallelGroup(Alignment.BASELINE)
- .addComponent(btnBuyBookedTrip, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)
- .addComponent(btnViewBookedTrips, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE))
- .addGap(43)
- .addComponent(btnBookTrip, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
- .addGap(49)
- .addGroup(gl_PassengerPanel.createParallelGroup(Alignment.BASELINE)
- .addComponent(btnViewAllTripsPassenger, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE)
- .addComponent(btnCancelBookedTrip, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE))
- .addGap(183))
- .addGroup(gl_PassengerPanel.createSequentialGroup()
- .addGap(44)
- .addComponent(btnPassengerLogout, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)
- .addContainerGap())))
- );
- PassengerPanel.setLayout(gl_PassengerPanel);
- DriverPanel = new JPanel();
- layeredPane.add(DriverPanel, "name_138956623298965");
- ManagerPanel = new JPanel();
- layeredPane.add(ManagerPanel, "name_138959191189031");
- JLabel label_1 = new JLabel("");
- label_1.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/traffic-sign_256.png")));
- JLabel previewManagerNamelbl = new JLabel("New label");
- JButton btnManagerLogout = new JButton("LOGOUT");
- btnManagerLogout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- if (JOptionPane.showConfirmDialog(null,"ARE YOU SURE YOU WANT TO LOGOUT?") == JOptionPane.YES_OPTION) {
- switchScenes(layeredPane, MainPanel);
- }
- }
- });
- btnManagerLogout.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/logout_16.png")));
- btnManagerLogout.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnViewAllTripsManager = new JButton("View All Trips");
- btnViewAllTripsManager.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnAddTrip = new JButton("Add Trip");
- btnAddTrip.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnCancelTrip = new JButton("Cancel Trip");
- btnCancelTrip.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnAssignTrip = new JButton("Assign Trip");
- btnAssignTrip.setFont(new Font("Tahoma", Font.PLAIN, 20));
- JButton btnViewAllDrivers = new JButton("View All Drivers");
- btnViewAllDrivers.setFont(new Font("Tahoma", Font.PLAIN, 20));
- GroupLayout gl_ManagerPanel = new GroupLayout(ManagerPanel);
- gl_ManagerPanel.setHorizontalGroup(
- gl_ManagerPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_ManagerPanel.createSequentialGroup()
- .addGroup(gl_ManagerPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_ManagerPanel.createSequentialGroup()
- .addGap(361)
- .addComponent(label_1)
- .addPreferredGap(ComponentPlacement.RELATED, 183, Short.MAX_VALUE)
- .addComponent(btnManagerLogout))
- .addGroup(gl_ManagerPanel.createSequentialGroup()
- .addContainerGap(860, Short.MAX_VALUE)
- .addComponent(previewManagerNamelbl)))
- .addGap(50))
- .addGroup(Alignment.TRAILING, gl_ManagerPanel.createSequentialGroup()
- .addGap(205)
- .addGroup(gl_ManagerPanel.createParallelGroup(Alignment.TRAILING)
- .addComponent(btnCancelTrip)
- .addComponent(btnViewAllTripsManager))
- .addPreferredGap(ComponentPlacement.RELATED, 270, Short.MAX_VALUE)
- .addGroup(gl_ManagerPanel.createParallelGroup(Alignment.LEADING)
- .addComponent(btnAssignTrip)
- .addComponent(btnViewAllDrivers))
- .addGap(205))
- .addGroup(gl_ManagerPanel.createSequentialGroup()
- .addGap(427)
- .addComponent(btnAddTrip)
- .addContainerGap(445, Short.MAX_VALUE))
- );
- gl_ManagerPanel.setVerticalGroup(
- gl_ManagerPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_ManagerPanel.createSequentialGroup()
- .addGap(34)
- .addComponent(previewManagerNamelbl)
- .addGroup(gl_ManagerPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_ManagerPanel.createSequentialGroup()
- .addPreferredGap(ComponentPlacement.RELATED)
- .addComponent(label_1, GroupLayout.PREFERRED_SIZE, 186, GroupLayout.PREFERRED_SIZE)
- .addGap(154)
- .addComponent(btnAddTrip, GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE)
- .addPreferredGap(ComponentPlacement.RELATED))
- .addGroup(Alignment.TRAILING, gl_ManagerPanel.createSequentialGroup()
- .addGap(46)
- .addComponent(btnManagerLogout, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED, 158, Short.MAX_VALUE)
- .addGroup(gl_ManagerPanel.createParallelGroup(Alignment.BASELINE)
- .addComponent(btnViewAllDrivers, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
- .addComponent(btnViewAllTripsManager, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE))
- .addGap(97)))
- .addGap(53)
- .addGroup(gl_ManagerPanel.createParallelGroup(Alignment.TRAILING)
- .addComponent(btnAssignTrip, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
- .addComponent(btnCancelTrip, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE))
- .addGap(171))
- );
- ManagerPanel.setLayout(gl_ManagerPanel);
- viewListPanel = new JPanel();
- layeredPane.add(viewListPanel, "name_233625677783422");
- JScrollPane scrollPane = new JScrollPane();
- scrollPane.setFont(new Font("Tahoma", Font.PLAIN, 18));
- scrollPane.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "List Of Required Trips", TitledBorder.LEFT, TitledBorder.TOP, null, new Color(0, 0, 0)));
- JButton btnProceed = new JButton("PROCEED");
- btnProceed.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- }
- });
- btnProceed.setFont(new Font("Tahoma", Font.PLAIN, 20));
- lblSelect = new JLabel("Select Your Desired Trip");
- lblSelect.setFont(new Font("Tahoma", Font.BOLD, 25));
- GroupLayout gl_viewListPanel = new GroupLayout(viewListPanel);
- gl_viewListPanel.setHorizontalGroup(
- gl_viewListPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_viewListPanel.createSequentialGroup()
- .addGap(337)
- .addComponent(lblSelect, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(338))
- .addGroup(gl_viewListPanel.createSequentialGroup()
- .addGap(51)
- .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 873, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(55, Short.MAX_VALUE))
- .addGroup(gl_viewListPanel.createSequentialGroup()
- .addContainerGap(810, Short.MAX_VALUE)
- .addComponent(btnProceed)
- .addGap(52))
- );
- gl_viewListPanel.setVerticalGroup(
- gl_viewListPanel.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_viewListPanel.createSequentialGroup()
- .addContainerGap()
- .addComponent(lblSelect)
- .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 606, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.UNRELATED)
- .addComponent(btnProceed, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- JList list = new JList(listModel);
- list.setFont(new Font("Tahoma", Font.PLAIN, 18));
- scrollPane.setViewportView(list);
- viewListPanel.setLayout(gl_viewListPanel);
- JMenuBar menuBar = new JMenuBar();
- menuBar.setBounds(0, 0, 979, 31);
- contentPane.add(menuBar);
- JMenu mnFile = new JMenu("File");
- mnFile.setFont(new Font("Segoe UI", Font.PLAIN, 20));
- menuBar.add(mnFile);
- JMenuItem mntmExit = new JMenuItem("Exit");
- mntmExit.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- JOptionPane.showConfirmDialog(null,"ARE YOU SURE YOU WANT TO EXIT?");
- }
- });
- mntmExit.setIcon(new ImageIcon(MainFrame.class.getResource("/BusStationFinal/resorces/exit_16.png")));
- mntmExit.setFont(new Font("Segoe UI", Font.PLAIN, 20));
- mnFile.add(mntmExit);
- JMenu mnAbout = new JMenu("About");
- mnAbout.setFont(new Font("Segoe UI", Font.PLAIN, 20));
- menuBar.add(mnAbout);
- JMenu mnHelp = new JMenu("Help");
- mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 20));
- menuBar.add(mnHelp);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement