Skip to main content

Minor issue in JXLoginDialog

No replies
Anonymous

Hi Richard,
I'm just unbelievably busy with a product release that must must be done for
August 1st (based on SwingX). Anyway I ran into a minor issue with the
JXLoginDialog where a failed login causes the dialog to repaint
incorrectly... The fix is trivial when a component is removed and a new one
added a repaint must be invoked as such (code from JXLoginDialog, my changes
is bold):

private final class Listener implements LoginListener {
public void loginSucceeded(LoginEvent source) {
setVisible(false);
}

public void loginStarted(LoginEvent source) {
//switch to login animation
buttonPanel.setVisible(false);
remove(contentPanel);
add(progressPanel, BorderLayout.CENTER);
repaint();
}

public void loginFailed(LoginEvent source) {
//switch to input fields, show error
buttonPanel.setVisible(true);
remove(progressPanel);
add(contentPanel, BorderLayout.CENTER);
repaint();
}

public void loginCanceled(LoginEvent source) {
//switch to input fields, show message
buttonPanel.setVisible(true);
remove(progressPanel);
add(contentPanel, BorderLayout.CENTER);
repaint();
}
}

This solved this garbling problem I was experiencing both on Linux and
Windows.

--
Shai Almog
vPrise Consulting
http://www.vprise.com/
[att1.html]