if(historyPos <= 1) getToolkit().beep();
if(historyPos == 1) { historyPos = 0; setText(current); } else if(historyPos < 1) getToolkit().beep();
	public void keyPressed(KeyEvent evt)	{		switch(evt.getKeyCode())		{		case KeyEvent.VK_DOWN:			if(historyPos <= 1)				getToolkit().beep();			else				setText(history[--historyPos - 1]);			evt.consume();			break;		case KeyEvent.VK_UP:			String line = history[historyPos];			if(line == null)				getToolkit().beep();			else			{				historyPos++;				setText(line);			}			evt.consume();			break;		}	}