Skip to main content

Multiline Message in JXLoginPane

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
durech56
Offline
Joined: 2009-12-01

I have been using a really old version of SwingX (.9.0). I recently tried to update to the tatest version (1.6.2) and find that the class name has been changed to JXLoginPane. No big deal. However, I had been able to set a multi-line message via JXLoginPane.setMessage() by passing it a HTML string of the form:
"<html><body>Enter your username and password to connect<br>to the XYZ Application at 192.168.0.45.</body></html>"
That worked fine and displayed the text as follows:
Enter your username and password to connect
to the XYZ Application at 192.168.0.45
Using the new JXLoginPane in 1.6.2, the same text is displayed as:
Enter your
username
and
password
to connect
to the
XYZ
Application
at
192.168.0.45.
Is there someway to get a multi-line text message to display correctly in the new JXLoginPane??

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
durech56
Offline
Joined: 2009-12-01

It appears that the VerticalLayout used in .9.0 was replaced by LoginPaneLayout in .9.1. This Layout Manager overrides the preferredLayoutSize() method and I believe is trying to make sure long message strings do not make the dialog grow too wide. However, it seems to have an adverse affect in my particular sitation.

kschaefe
Offline
Joined: 2006-06-08

Have you tried without the HTML code? I thought the point of the change was to help with such cases. I haven't gotten a chance to dig into it yet, so I could be off-base.
Karl

durech56
Offline
Joined: 2009-12-01

I tried specifying my message as just a plain text string and it did not wrap. The text string was just truncated at about the half way point.

kschaefe
Offline
Joined: 2006-06-08

OK. Can you please file a bug report so we don't loose track of this? We need to make sure that we don't mess up long message clipping when we fix this.
Karl