Results 1 to 1 of 1
- 04-20-2009, 11:08 AM #1Member
- Join Date
- Apr 2009
- Rep Power
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.
- By sk8rsam77 in forum New To JavaReplies: 11Last Post: 02-26-2010, 04:03 AM
- By DenniGa in forum Java AppletsReplies: 3Last Post: 02-24-2009, 03:10 AM
- By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 07:56 PM
- By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM
- By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-27-2008, 01:20 AM