Solved

Applets no longer load/paint properly with 1.4.0

Posted on 2002-04-29
10
251 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

773 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