import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class JPictureJavaExample extends JApplet implements ActionListener
{
private ImageIcon img = new ImageIcon("Koala.jpg");
private JButton ZoomBtn = new JButton("Zoom..!");
private int Hght,Wdth;
Container cntnr = getContentPane();
public void init()
{
cntnr.setLayout(new FlowLayout());
ZoomBtn.addActionListener(this);
cntnr.add(ZoomBtn);
Wdth = img.getIconWidth();
Hght = img.getIconHeight();
}
public void actionPerformed(ActionEvent event)
{
Wdth = Wdth * 2;
Hght = Hght * 2;
repaint();
}
public void paint(Graphics gp)
{
super.paint(gp);
gp.drawImage(img.getImage(), 0, 0, Wdth, Hght, this);
}
}