JtextPane does not display properly when initialized with ""
We have migrated a swing application from Java 1.4.2 (IBM) to 1.5 (IBM).
In this application I have a Panel to display account information that contains two components (mine ones) that are subclasses of JTextPane. These components represents possible status of an account (an account can have status 1 and substatus 2 for example).
When this panel is accessed it always trigger a method called populated fields that in turns populate these specific components (see pseudo code below):
// initialize the texts with .
// then populate them with data if the data is available. An account can have only status 1 or only status 2 or both.
If (there is data for Comp1)
If(there is data for Comp2);
My problem happens when I access this panel and there is data just for Comp1 then it displays it OK. (Account with only status 1)
Then I access another account that has data just for status 2 (Account with only status 2) In this case depending on the size of the Window it does not display . I have to resize the Window (increase it) until it displays.
If I initialized the Components with (one whitespace) instead of then it also works fine.
Also After I resize the window to make the status been displayed and then I access another account then this new account will not have any problem regarding to display. Actually the issue will disappear until I restart my swing application.
So I am trying to understand why resize or initialize the text with works. My issue here is that my components does other things linke underline text so when I start them as whenever one has no data to display it still displays a small underline _.
In order to migrate this application from 1.4.2 to 1.5 (IBM) we did change code but not the ones directly involved here. Could it be an java 1.5 issue?
Any help is very welcome.
The layoutmanager used is BorderLayout.
The Panel is initialized when the application is started.