@Override
	public void actionPerformed(ActionEvent arg0) {
		List<Integer> orderList = new ArrayList<Integer>();
		String userName = "";
		
        JTextField field1 = new JTextField("");
        JPanel panel = new JPanel(new GridLayout(0, 1));
        panel.add(new JLabel("Login or user name:"));
        panel.add(field1);
 
        int result = JOptionPane.showConfirmDialog(frame, panel, "User orders window",
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
        if (result == JOptionPane.OK_OPTION && !field1.getText().equals("")) {
        	
        	
			try {
				userName = field1.getText();
				
				String query = "select order_id from orders where order_handler = '"+userName+"'";
				
				PreparedStatement ps = orders.getConnection().prepareStatement(query);
				ResultSet results = ps.executeQuery();
				
				while(results.next()) {
					orderList.add(results.getInt("order_id"));
				}
				JList list = new JList(orderList.toArray());
				JPanel panel2 = new JPanel(new GridLayout(0, 1));
		        panel2.add(new JLabel("Results:"));
		        panel2.add(list);
		        
		        JOptionPane.showMessageDialog(frame, panel2,"Results window", JOptionPane.PLAIN_MESSAGE);
				
			} catch (NumberFormatException e) {
				JOptionPane.showMessageDialog(frame, "wrong number somewhere.");
			} catch (SQLException e) {
				JOptionPane.showMessageDialog(frame, "Something went wrong when connecting to database.");
				
			}
		}
        else if (result == JOptionPane.CANCEL_OPTION) {
        }
	}