Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Applets no longer load/paint properly with 1.4.0

Posted on 2002-04-29
10
Medium Priority
?
262 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

877 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