public void paste(SimpleFrame panelText)
	{
		panelText.setAction(false);
		String clipboardText = null;
        Transferable trans = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
         
        if (trans != null && trans.isDataFlavorSupported(DataFlavor.stringFlavor)) 
        {
             try 
             {
				clipboardText = (String) trans.getTransferData(DataFlavor.stringFlavor);
				int position = panelText.getText().getCaretPosition();
                ActionsHistoryImpl.action type = ActionsHistoryImpl.action.ADD;
                ActionData data = new ActionData(panelText.getText().getCaretPosition(),panelText.getText().getText(), false);
                String login = panelText.getLogin();
                data = panelText.getList().newPutString(clipboardText, position, type, data, login);
                panelText.getText().setText(data.getPanelText());
                panelText.getText().setCaretPosition(data.getCaretPosition());
				panelText.setIsChanged(data.getChanged());
			} 
            catch (UnsupportedFlavorException e) 
            {
            	JOptionPane.showMessageDialog(panelText, "Pasting error");
			} 
            catch (IOException e) 
            {
            	JOptionPane.showMessageDialog(panelText, "Disconect from server");
			}
         }
                
        if(panelText.getText().getCaretPosition() == 0)
		{
        	panelText.getText().setText(clipboardText + panelText.getText().getText());
        	panelText.setAction(true);
        	return;
		}
		if(panelText.getText().getCaretPosition() > 0 && panelText.getText().getCaretPosition() < panelText.getText().getText().length())
		{
			int begin1 = 0;
			int finish1 = panelText.getText().getCaretPosition();
			String text1 = panelText.getText().getText().substring(begin1, finish1);
			int begin2 = panelText.getText().getCaretPosition();
			int finish2 =panelText.getText().getText().length();
			String text2 = panelText.getText().getText().substring(begin2, finish2);
			panelText.getText().setText(text1 + clipboardText + text2);
			panelText.setAction(true);
			return;
		}
		if(panelText.getText().getCaretPosition() == panelText.getText().getText().length())
		{
			panelText.getText().setText(panelText.getText().getText() + clipboardText);
			panelText.setAction(true);
			return;
		}
	}