if ( e.getKeyCode() == KeyEvent.VK_ENTER ) {
okButt.doClick();
return;
}
javax.swing.Timer timer = new Timer( 50,
new ActionListener() {
public void actionPerformed(ActionEvent e)
{
String constr = tf.getText();
try {
if ( tf == layoutConstrTF ) {
ConstraintParser.parseLayoutConstraint( constr );
} else if ( tf == rowsConstrTF ) {
ConstraintParser.parseRowConstraints( constr );
} else if ( tf == colsConstrTF ) {
ConstraintParser.parseColumnConstraints( constr );
} else if ( tf == componentConstrTF ) {
ConstraintParser.parseComponentConstraint( constr );
}
tf.setBackground( Color.WHITE );
okButt.setEnabled( true );
} catch ( Exception ex ) {
tf.setBackground( ERROR_COLOR );
okButt.setEnabled( false );
}
}
} );
timer.setRepeats( false );
timer.start();
}
} );
return tf;
}