C
Cheok Yan Cheng
dear all,
i try to dispaly d icon within d JApplet but it wont work. the
following code compiled no problem but nothing had been shown
any suggested solution on this problem?
thank you.
regards
yccheok
-------------------------------------------------------------------------------
// LoadImageAndScale.java
//
// Load and display the image as an ImageIcon.
import java.applet.Applet;
import java.awt.*;
import javax.swing.*;
public class LoadImageAndScale extends JApplet
{
private ImageIcon logo2;
// load the image when the applet is loaded
public void init()
{
logo2 = new ImageIcon( getCodeBase()+"logo.gif" );
repaint();
}
// display the image
public void paint( Graphics g )
{
logo2.paintIcon( this, g, 0, 0 );
}
}
i try to dispaly d icon within d JApplet but it wont work. the
following code compiled no problem but nothing had been shown
any suggested solution on this problem?
thank you.
regards
yccheok
-------------------------------------------------------------------------------
// LoadImageAndScale.java
//
// Load and display the image as an ImageIcon.
import java.applet.Applet;
import java.awt.*;
import javax.swing.*;
public class LoadImageAndScale extends JApplet
{
private ImageIcon logo2;
// load the image when the applet is loaded
public void init()
{
logo2 = new ImageIcon( getCodeBase()+"logo.gif" );
repaint();
}
// display the image
public void paint( Graphics g )
{
logo2.paintIcon( this, g, 0, 0 );
}
}