Skip to main content

JXLoginDialog/JXLoginPanel fixes

No replies
rbair
Offline
Joined: 2003-07-08

Hey folks,

I've worked all week on bug fixes for JXLoginDialog and JXLoginPanel. Here are the fixed issues:
Issue #84: NPE if JXTitledPanel colors have not been set on UIManager
Issue #110: DefaultUserNameStore.saveUserNames: key too long
Issue #124: cancelButton: size setting does not honor font settings/text
Issue #125: LoginService: startAuthentication needs to catch exceptions
Issue #126: JXLoginDialog#progressPanel not updated
Issue #127: JXLoginDialog#getState()
Issue #128: cancel login on WINDOW_CLOSE

These fixes have now been committed to the trunk.

While fixing these, I came across two issues which I'd like to get some broader feedback on.

First, the JXLoginPanel now has PLAF support. This was the single biggest driver in the (massive) redesign that you will see in the source code. Note that normal usage of JXLoginDialog hasn't changed much (if at all), but internally things are much different. JXLoginPanel used to contain the user name, password field, and "remember password" checkbox. It now also contains the optional login message and banner (allowing the banner to be based on the look and feel).

Because essentially all of the login logic is happening in the JXLoginPanel, I also added JOptionPane-ish static methods for creating login frames and login dialogs. The top level JXLoginDialog still exists -- but this is the thing I would like some feedback on. Do you prefer a top level JXLoginDialog, or the JOptionPane-ish static creation methods? Is the clarity of having a JXLoginDialog (and JXLoginFrame!) worth the clutter it causes in the package?

Second, the LoginService was throwing IOException, which didn't make sense for a lot of different login scenarios. As a result, it was suggested to go with Exception. I've done that for now. However, I wanted to get some opinions on whether it is better to have LoginService throw Exception or AuthenticationException.

Put more generally, is it worth creating a new Exception class for different packages? I know it seems to be the standard practice, but is it habit or is there a good reason for it?

Cheers
Richard

PS> I'm still trying to commit. For some reason, JXLoginPanel and JXLoginDialog won't commit (grayed out in the IDE menu).