I have added ComponentListener
to JTextField
parent like this:
parent.addComponentListener(new ComponentAdapter() {
@Override
public void componentHidden(ComponentEvent e) {
setText("");
}
});
So after parent becomes invisible, textField
text is set to "". Everything works, but the problem is when I set parent to visible - for some milliseconds previous text of textField
is displayed, and then field becomes empty. So it's not very nice..