// users wants to edit the text... When means the only way to exit the native text box
// is via the cancel option (after pressing OK once).
triggerClose = action == Display.GAME_FIRE;
//scroll the TextArea
Rectangle rect = new Rectangle(getScrollX(), getScrollY(), getWidth(), getHeight());
Font textFont = getStyle().getFont();
if(action == Display.GAME_DOWN){
if((getScrollY() + getHeight()) <(rowsGap + getStyle().getFont().getHeight()) * getLines()) {
rect.setY(rect.getY() + textFont.getHeight() + rowsGap);
scrollRectToVisible(rect, this);
} else {
setHandlesInput(false);
}
}else if(action == Display.GAME_UP){
if(getScrollY() > 0) {
rect.setY(Math.max(0, rect.getY() - textFont.getHeight() - rowsGap));
scrollRectToVisible(rect, this);
} else {
setHandlesInput(false);
}
}