OpenProjFrame(final ConnectMethods list, final String login)
	{
		setTitle("Choose project...");
		this.setList(list);
		this.setLogin(login);
		opf = this;
		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension screen = kit.getScreenSize();
		
		scr_w = screen.width;
		scr_h = screen.height;
		this.setLocation(scr_w/2 - 150, scr_h/2 - 100);
		setTitle("Login...");
		setSize(350, 300);
		
		ArrayList<String> projList = null;
		try 
		{
			projList = list.getProjectList();
		} 
		catch (RemoteException e2) 
		{
			JOptionPane.showMessageDialog(buttonNew, "Disconnect from server");
		}
		DefaultListModel<String> listModel = new DefaultListModel<String>();
		for(int i = 0; i < projList.size(); i++)
		{
			listModel.addElement(projList.get(i));
		}
		if(listModel.size() == 0)
		{
			listModel.addElement("<no avalible projects>");
		}
		name = new JLabel("Open project");
		name.setAlignmentX(LEFT_ALIGNMENT);
		ProjList = new JList<String>(listModel);
		ProjList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		ProjList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
		ProjList.setAlignmentX(LEFT_ALIGNMENT);
		ProjList.addMouseListener(new MouseListener()
		{
			public void mouseClicked(MouseEvent arg0) 
			{
				if(arg0.getClickCount() == 2)
				{
					Open();
				}
			}
			public void mouseEntered(MouseEvent arg0) {}
			public void mouseExited(MouseEvent arg0) {}
			public void mousePressed(MouseEvent arg0) {}
			public void mouseReleased(MouseEvent arg0) {}
		});
		ProjName = new JLabel("New project");
	    ProjName.setAlignmentX(LEFT_ALIGNMENT);
	    NameTextField = new JTextField(13);
	    NameTextField.setAlignmentX(LEFT_ALIGNMENT);
	    NameTextField.setMaximumSize(NameTextField.getPreferredSize());
	    NameTextField.addKeyListener(new KeyListener()
		{
			public void keyPressed(KeyEvent arg0) 
			{
				if(arg0.getKeyCode() == KeyEvent.VK_ENTER) New();
			}
			public void keyReleased(KeyEvent arg0){}

			public void keyTyped(KeyEvent arg0){}
		});
	       
	    buttonNew = new JButton("New");
	    buttonNew.addActionListener(new ActionListener()
	    {
			public void actionPerformed(ActionEvent e) 
			{
				New();
			}
	    });
	    buttonNew.addKeyListener(new KeyListener()
		{
			public void keyPressed(KeyEvent arg0) 
			{
				if(arg0.getKeyCode() == KeyEvent.VK_ENTER)
				{
					New();
				}
			}
			public void keyReleased(KeyEvent arg0){}
			public void keyTyped(KeyEvent arg0){}
		});
	    buttonOpen = new JButton("Open");
	    buttonOpen.addActionListener(new ActionListener()
	    {
			public void actionPerformed(ActionEvent e) 
			{
				Open();
			}
	    });
	    buttonOpen.addKeyListener(new KeyListener()
		{
			public void keyPressed(KeyEvent arg0) 
			{
				if(arg0.getKeyCode() == KeyEvent.VK_ENTER)
				{
					Open();
				}
			}
			public void keyReleased(KeyEvent arg0){}

			public void keyTyped(KeyEvent arg0){}
		});
	    buttonCancel = new JButton("Cancel");
	    buttonCancel.addActionListener(new ActionListener()
	    {
	    	public void actionPerformed(ActionEvent arg0) 
	    	{
				System.exit(0);
			}
	    	
	    });
	    buttonCancel.addKeyListener(new KeyListener()
		{
			public void keyPressed(KeyEvent arg0) 
			{
				if(arg0.getKeyCode() == KeyEvent.VK_ENTER) System.exit(0);
			}
			public void keyReleased(KeyEvent arg0){}

			public void keyTyped(KeyEvent arg0){}
		});
	    
	    Dimension buttonSize = buttonCancel.getPreferredSize();
	    buttonNew.setPreferredSize(buttonSize);
	    buttonNew.setMaximumSize(buttonSize);
	    buttonNew.setMinimumSize(buttonSize);
	    buttonOpen.setPreferredSize(buttonSize);
	    buttonOpen.setMaximumSize(buttonSize);
	    buttonOpen.setMinimumSize(buttonSize);
	    buttonCancel.setPreferredSize(buttonSize);
	    buttonCancel.setMaximumSize(buttonSize);
	    buttonCancel.setMinimumSize(buttonSize);
	    
	    Dimension listSize = new Dimension(350 - buttonSize.width - 40 ,200);
	    ProjList.setPreferredSize(listSize);
	    ProjList.setMaximumSize(listSize);
	    ProjList.setMinimumSize(listSize);
	    
	    vbox1 = Box.createVerticalBox();
		vbox1.add(Box.createVerticalStrut(5));
		vbox1.add(name);
		vbox1.add(Box.createVerticalStrut(2));
	    vbox1.add(ProjList);
	    vbox1.add(Box.createVerticalStrut(5));
	    vbox1.add(ProjName);
	    vbox1.add(Box.createVerticalStrut(2));
	    vbox1.add(NameTextField);
	    vbox1.add(Box.createGlue());
	    	    
	    vbox2 = Box.createVerticalBox();
	    vbox2.add(Box.createVerticalStrut(20));
	    vbox2.add(buttonNew);
	    vbox2.add(Box.createVerticalStrut(5));
	    vbox2.add(buttonOpen);
	    vbox2.add(Box.createVerticalStrut(5));
	    vbox2.add(buttonCancel);
	    vbox2.add(Box.createGlue());
	    vbox2.add(Box.createVerticalStrut(5));

	    hbox = Box.createHorizontalBox();
	    hbox.add(Box.createHorizontalStrut(5));
	    hbox.add(vbox1);
	    hbox.add(Box.createHorizontalGlue());
	    hbox.add(vbox2);
	    hbox.add(Box.createHorizontalStrut(5));
	    hbox.setAlignmentX(RIGHT_ALIGNMENT);
	    
	    contentPane = getContentPane();
	    contentPane.add(hbox, BorderLayout.CENTER);
	    this.setResizable(false);
	}