Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

Problem during the init() phase in a JApplet using a JTextPane

Thread view: 
Alexandre Lahure - 23 May 2005 16:07 GMT
Hi all,

I wrote a small text editor (using a JTextPane) in order to ease the use  
of a CMS, in a more WYSIWYG way. Basically, you can see directly the  
effect of setting the background color, the text color,  
bold/italic/underlined styles and so on... You can have several applet on  
one page as there is one applet per column and per language.

As it's used in a CMS, it uses liveconnect (javascript interaction)  
massively to get the default values of the styles and the content text  
from the HTML page.

The problem is that on first page load, the applet doesn't initialize  
correctly: the background color is not always loaded correctly, neither  
are the text color or style. It can happen that the text of one applet is  
duplicated in another. It even happens that in place of the content text,  
I find the value of the text color (ie. #777777), the value of the text  
alignment or whatever.

Note the this problem occurs under IE exclusively and fades away on page  
reload. Firefox, Opera and Konqueror work just fine.

So at first sight, the problem is due to a bad page loading in IE, so I  
placed several sleep() in the init() method: one before each style  
initialization.
Sadly, it doesn't seem to have any effect.

Does anyone here already encoutered this problem ?

Thanks in advance for your help.

Signature

Alexandre

Computers are like air conditioners
They don't work when you open windows

Andrew Thompson - 23 May 2005 16:58 GMT
> So at first sight, the problem is due to a bad page loading in IE, so I  
> placed several sleep() in the init() method: one before each style  
> initialization.
> Sadly, it doesn't seem to have any effect.

Though I have considerable experience with Applets, and some with JS,
I am not too familiar with the JS->Java LiveConnect stuff.

Having said that, I suspect you are better off asking the JS people
for a JS solution, since it sounds as though the IE DOM is taking longer
to build (or the applet less time to launch) - and they will probably
have some good ideas on how to detect the completion of the process.

HTH

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Alexandre Lahure - 23 May 2005 17:06 GMT
>> So at first sight, the problem is due to a bad page loading in IE, so I
>> placed several sleep() in the init() method: one before each style
[quoted text clipped - 8 lines]
> to build (or the applet less time to launch) - and they will probably
> have some good ideas on how to detect the completion of the process.

OK, I'll post there too

Signature

Alexandre

Computers are like air conditioners
They don't work when you open windows



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.