This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

resizing browser activates init?

 
paul wheaton
Trailboss
Pie
Posts: 21880
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an applet that does a bunch of stuff. Two problems I have are
1) I have a lightweight component that goes in a ScrollPane. The info in the scrollpane does not show up unless I resize the browser a pinch.
2) Sometimes when I resize the browser a pinch, my applet starts over at the beginning! I put some System.out.println stuff in init and verified that init is being called again! On some other computers using the exact same browser (Netscape 4.61) init gets called EVERY time you resize the browser. What's up with that?

 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that you already know this but... It is curious that you are mixing a "light" weight component with a "heavy" weight like ScrollPane. Seems that I have always had problems when mixing these, and all of the Swing books advise against it. Doing this in an applet will only multiply the problems encountered (see reply to second problem below).
To fix the problems that I encountered, I switched to using the JScrollPanel.
As for your second problem, welcome to the Wild-Wild World of Browsers and Java! You need to check that all of the browsers are using the same plug-in(s), and jre version. Otherwise results WILL very even though you're using the same browser make and version.
Hasta-la-Pasta, and to all a good night...
Matt
[This message has been edited by Matt Midcap (edited October 28, 1999).]
 
paul wheaton
Trailboss
Pie
Posts: 21880
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to work with some assumptions on the browsers that will use my applet. Java 1.1 is okay, but Swing is out. Otherwise I would use Swing!
In this case, my lightweight component is nothing more than a class I made that inherits Panel. I have to have some way to show this stuff.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may be off the wall here, but have you checked out the details of the enclosing page (including the headers sent from the server). I know that Netscape is more draconian about reloading pages than IE, and a page reload could easily force an applet init.
 
paul wheaton
Trailboss
Pie
Posts: 21880
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The enclosing html is very basic. Is there something in particular I should look for or add?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic