Solved

AWT Applet Scroll Problem

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -ano | find "8000" and taskkill /f /pid 2984 3 83
going to wrong jsp page 2 33
ejb entity bean example issue 2 16
Java class and jar 3 20
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

808 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