Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

resizing browser activates init?

 
Trailboss
Posts: 23192
IntelliJ IDE Firefox Browser 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?

 
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
Posts: 23192
IntelliJ IDE Firefox Browser 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.
 
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
Posts: 23192
IntelliJ IDE Firefox Browser 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?
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
ScroogeXHTML 9.0 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/731949/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic