Solved

AWT Applet Scroll Problem

Posted on 2002-07-26
6
735 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now