Solved

Applets no longer load/paint properly with 1.4.0

Posted on 2002-04-29
10
249 Views
Last Modified: 2013-11-23
After installing the 1.4.0 jre/plugin the only way I can get applets to work properly is to move the mouse cursor over the applet. Once I do that all is ok but if I do not the browser just hangs loading the applet or does not completely paint the applet. I have tried this with IE6 and Netscape 6.2. I also have tried it on other computers that were working fine with 1.3 but after installing 1.4.0 the same problem occurs.
This seems to happen even on simple example applets.
I have the plugin installed.
The applet viewer has the same problem.
I also installed the 1.4.0 runtime / plugin on a seperate pc that was working just fine before (loading test applets of various sites) that after the install has the same problem.
Note that pc and mine are both w2k sp2.

I just generated a very simple awt applet and added the following paint code.
public void paint(Graphics g)
{
// Set the applet background to white
setBackground(Color.white);
// now draw the outlines for the therms
// Air
g.setColor(Color.black);
g.drawRect(30,110,10,120);
// Black
g.drawRect(130,110,10,120);
// Silver
g.drawRect(230,110,10,120);

// fill in the black
g.fillRect(131,111,9,119);

// fill in the air
g.setColor(Color.red);
g.fillRect(31,111,9,119);

// fill in the silver
g.setColor(Color.gray);
g.fillRect(231,111,9,119);

}
Running in the applet viewer the black and red Rects fill in properly but the silver does not paint unless I move the mouse cursor onto the applet. Then it paints the silver. Very strange indeed !
0
Comment
Question by:mikeu
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 6977878
 Indeed it is strange. I had a similar problem and all i did was to override the update method, and, as if by magic it worked. Maybe it would help you as well.

public void update(Graphics g)
{
    paint(g);
}
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6979601
1. overwrite the update method like above
2. use double buffering
0
 
LVL 92

Expert Comment

by:objects
ID: 6979866

Can you post a complete applet that demonstrates the problem?
0
 
LVL 92

Expert Comment

by:objects
ID: 6979882
0
 

Author Comment

by:mikeu
ID: 6981673
This is what I am testing with.

/*
 * test.java
 *
 * Created on April 27, 2002, 11:19 AM
 */
import java.awt.*;
/**
 *
 * @author  mikeu
 */
public class test extends java.applet.Applet {

    /** Initializes the applet test */
    public void init() {
        initComponents();
    }
   
   
   
    public void update(Graphics g)
    {
        paint(g);
    }
   
    public void paint(Graphics g)
     {
          setBackground(Color.white);
          // now draw the outlines for the therms
          // Air
          g.setColor(Color.black);
          g.drawRect(30,50,10,60);
          // Black
          g.drawRect(130,50,10,60);
          // Silver    
          g.drawRect(230,50,10,60);
         
                // fill in the black
          g.fillRect(131,51,9,59);

                // fill in the silver
          g.setColor(Color.gray);
          g.fillRect(231,51,9,59);

          // fill in the air
          g.setColor(Color.red);
          g.fillRect(31,51,9,59);
             
    }
     
    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
       
        setLayout(new java.awt.BorderLayout());
       
    }//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:mikeu
ID: 7032040
I have noticed that this seems to happen on the pc's I have that have a GeForce2 Go nVidia graphics card. Anybody run across this video card ?
0
 
LVL 35

Expert Comment

by:girionis
ID: 7033249
 Well we are all working in the IT industry and as we know we can never be sure with computers. If you are really concerned about this and you have not solved your problem I would suggest to take a look at the GeForce and nVidia documentation and see if there are any known problems.

  From experience I have used in the past computers with nVidia and have never had any problems.
0
 
LVL 92

Expert Comment

by:objects
ID: 7033524
1.4.0 has lots of repaint regression problems, and it looks very much like this is your problem. Many are reported as being fixed in hopper (1.4.1).

0
 
LVL 9

Expert Comment

by:Venci75
ID: 7992618
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:
PAQ'd and pts refunded
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8048265
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

706 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

17 Experts available now in Live!

Get 1:1 Help Now