public LoginPanel() {
		super();
		
		setLayout(new GridBagLayout());
		clicked = false;
	    username.addMouseListener(new MouseAdapter(){
	    	
	        public void mouseClicked( MouseEvent e ){
	        	if ( !clicked ) {
	        		clicked = true;
	        		username.setText("");
	        		return;
	        	}
        		username.removeMouseListener(this);
	        }
	        
	    });
	    
	    username.addKeyListener(new KeyListener(){
	    	
	        public void keyTyped( KeyEvent e ){
	        	if ( !clicked ) {
	        		clicked = true;
	        		username.setText("");
	        		return;
	        	}
        		username.removeKeyListener(this);
	        }

			public void keyReleased(KeyEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			public void keyPressed(KeyEvent arg0) {
				// TODO Auto-generated method stub
				
			}
	        
	    });
	    
	    password.addKeyListener(new KeyListener(){
	    	
	        public void keyTyped( KeyEvent e ){
	        }

			public void keyReleased(KeyEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			public void keyPressed(KeyEvent arg0) {
				if( arg0.getKeyCode()==KeyEvent.VK_ENTER) {
					login();
				}
			}
	        
	    });	    
	    
		grid.insets = new Insets(0, 10, 75, 10);
		grid.gridy = 0;
		grid.gridx = 0;
		grid.gridwidth = 2;
		add(logo,  grid);
		grid.insets = new Insets(0, 10, 5, 10);
		grid.gridy = 1;
		grid.gridx = 0;
		grid.gridwidth = 2;
		add(log, grid);
		grid.gridwidth = 1;
		grid.gridy = 2;
		add(user, grid);
		grid.gridx = 1;
		add(username, grid);
		grid.gridx = 0;
		grid.gridy = 3;
		add(pass, grid);
		grid.gridx = 1;
		add(password, grid);
		grid.gridx = 0;
		grid.gridy = 4;
		add(register, grid);
		grid.gridx = 1;
		add(login, grid);
		
		clicked = false;
		login.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				login();
			}
		});
		register.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String user = username.getText().trim();
				String pass = new String(password.getPassword()).trim();
				
				if(user.length()>0 && pass.length() >0){
					commandHandler.sendCommand(new RegisterCommand(user, pass));
					waitForRespond();
				}else{
					loginMessage("Password or Username not specified");
				}
				
				
			}
		});
		
		username.requestFocusInWindow();
		
	}