|
||
|
|||
|
Lads,
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 “” . Comp1.setText(“”); Comp2setText(“”); // 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) Comp1.setText(data); If(there is data for Comp2); Comp2.setText(data); 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.
|
|
||||
|
Good afternoon orfano and welcome to the Java Programming Forums
![]() Would it be possible to post all of the code so I can compile it and see the error for myself?
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight] Forum Tip: Add to peoples reputation ( ) by clicking the button on their useful posts.
|
|
|||
|
Hello there,
I am trying to reproduce it in a more short way as the whole code is huge and impossible to run without having the server part as well. As soon as I got a short version of the issue I will post the code. cheers, |
|
||||
|
Quote:
What happens when you initialized the Components with null instead of "" or " " ?
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight] Forum Tip: Add to peoples reputation ( ) by clicking the button on their useful posts.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Exception in thread "main" java.lang.NullPointerException | oscardog | Exceptions | 16 | 27-08-2010 08:30 PM |
| Exception in thread "main" java.util.IllegalFormatWidthException: 13 | xtrive | Exceptions | 2 | 23-03-2010 05:38 AM |
| Drawing "Hello world" on screen | shikh_albelad | Java SE APIs | 4 | 11-06-2009 08:21 AM |
| [SOLVED] Problem with Java: "GridLayout" laying out the top part of my assignment? | antitru5t | AWT / Java Swing | 3 | 16-04-2009 03:26 PM |