Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2009, 05:19 AM
Registered User
 
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to orfano
Default JTextPane does dont display whne initilaized with ""

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.
 
Old June 25th, 2009, 05:54 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

try calling the validate() method on the container which has it.
__________________
- Rakesh
http://iam-rakesh.blogspot.com
 
Old July 13th, 2009, 11:07 PM
Registered User
 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default About java2EE

I learn java only few month.I am happpy to share your recuouse
thang you





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a files general property of "Type of file" GregSivers Visual Basic 2008 Essentials 7 June 3rd, 2009 09:38 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM
Chapter-5 on Intents:ContactPickerTester does not show the button "Pick a Contact" sunilm12 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 April 15th, 2009 11:55 AM
What "build in" funtionality can databound controls use (like GridV.) use with mySQL? allan_ravn ASP.NET 3.5 Professionals 0 April 14th, 2009 03:20 PM
How to download Code in "Professional Active Server Page 3.0 " book. renjith0 All Other Wrox Books 2 April 2nd, 2009 05:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.