Solved

Applets no longer load/paint properly with 1.4.0

Posted on 2002-04-29
10
252 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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
runtime exception 2 41
null output 3 35
jsp login check 12 42
difference between sorce folder and folder in eclipise 3 28
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

856 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