Solved

Applets no longer load/paint properly with 1.4.0

Posted on 2002-04-29
10
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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
 

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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.
Suggested Courses

635 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