private void menubar(){
		//construct the menubar
		JMenu M_patient = new JMenu("Patient");
		menubar.add(M_patient);
		JMenuItem newpatient = new JMenuItem("New");
		JMenuItem searchpatient = new JMenuItem("Search");
		M_patient.add(newpatient);
		newpatient.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				patient = null;
				try {
					patientPage();
				} catch (ParseException e1) {
					e1.printStackTrace();
				}
				PB_save.setEnabled(true);
				PB_update.setEnabled(false);
				cardLayout.show(contentPane, "Patient");
			}});
		M_patient.add(searchpatient);
		searchpatient.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(contentPane, "Search");
			}});

		JMenu clinic = new JMenu("Clinic");
		menubar.add(clinic);
		JMenuItem openinghr = new JMenuItem("Opening Hour");
		JMenuItem medicTreat = new JMenuItem("Medical Treatment");
		JMenuItem specCond = new JMenuItem("Special Condition");
		clinic.add(openinghr);
		openinghr.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(contentPane, "c_OH");
			}});
		clinic.add(medicTreat);
		medicTreat.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				c_MTPage();
				cardLayout.show(contentPane, "c_MT");
			}});
		clinic.add(specCond);
		specCond.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(contentPane, "c_SC");
			}});

		JMenu account = new JMenu("Account");
		menubar.add(account);
		JMenuItem changePassword = new JMenuItem("Change Password");
		JMenuItem logout = new JMenuItem("Log out");
		account.add(changePassword);
		changePassword.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				try{
				String password = JOptionPane.showInputDialog(null,"Please input your current password");
				if (Staff.checkLogin(db, logAc, userName, password.toCharArray())!=0){
					password = JOptionPane.showInputDialog(null,"Please input your new password");
					int index = 0;
					if (mode==1){
						while (index < logAc.getDoctorSize()){
							if (logAc.getDoctor(index).getUserName().equals(userName))
								logAc.getDoctor(index).setPassword(password);
							index++;
						}
					} else if (mode==2){
						while (index < logAc.getAdminSize()){
							if (logAc.getAdmin(index).getUserName().equals(userName))
								logAc.getAdmin(index).setPassword(password);
							index++;
						}
					}
				}
				} catch (NullPointerException e2){
				}
			}});
		account.add(logout);
		logout.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e) {
				logout();
			}});
	}