Solved

AWT Applet Scroll Problem

Posted on 2002-07-26
6
742 Views
Last Modified: 2013-12-29

When the Applet's size is more than  the display size on the browser. User tends to use the scroll bar of the browser for better view of it.

 In doing so the repaint is not workinng properly & applet's display is getting distorted. This is noticed in IE 5.5 /6 on win 2k & XP machines
0
Comment
Question by:pvamsikris
6 Comments
 
LVL 16

Expert Comment

by:heyhey_
ID: 7183396
post URL for applet that reproduces the problem.
0
 

Accepted Solution

by:
gingiGuy earned 100 total points
ID: 7185011
This is a problem with AWT and Microsoft's Java Runtime Environement for Internet Explorer. This would most likely be fixed by using the Java Plugin by Sun ( availible from http://java.sun.com)(although i cant test it as i dont have your code).

However, i do appreciate that many people (including myself in most circumstances) prefer not to force users to install additional software (such as the JRE Plugin).

A possible solution might be to start a seperate thread from init(), in which you would call the repaint() method of any Panels, content pains, etc that are causing problems.

Hope this helps

Guy
0
 

Author Comment

by:pvamsikris
ID: 7190097

  What I am saying is that its happening if I have many controls in my Applet. If I have less controls its not the problem. Is it a known fact or is there some kind off workaround or some thing wrong in the code ?
0
 

Expert Comment

by:gingiGuy
ID: 7190307
Yea, its a known fact that MSIE and scrolling pages with applets on dont go well together. Sometimes you might be lucky, and a simple applet will work without a problem, however, more often than not, MSIE will not redraw the applet properly when you scroll.

This is sometimes fixed by calling the repaint() method of all of the panels, panes and any other visible (or invisible) objects. This is however, not a proven, reliable, or "nice" solution.
I have the same problem with an applet that is being used in my firm, it was on a static (non scrolling) page till recently, however, the page now scrolls (not under my control), and the applet looks very silly, sorta replicating itself ontop of itself as the page scrolls. This is so bad that we will have to remove the applet.
As i said before you could try calling repaint every second from within another thread :

(pseeudo code : )
Thread {
  while( true ) // Infinite loop {
    wait 1 second
    object1.repaint()
    object2.repaint()
    ...
    ...
    ...
    objectn.repaint()
  }
}

Hope this has been of some help to you.
Guy
0
 
LVL 35

Expert Comment

by:girionis
ID: 8952265
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to gingiGuy

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 44
backtracking recursion  code 19 58
Java Server Faces parameter pass? 6 50
print map entry 34 68
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question