Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

image not showing

  Asked By: Leona    Date: Jul 10    Category: Java    Views: 1772

Can anyone suggest or explain to me why this image is not showing?

import javax.swing.*;
import java.awt.*;
import java.applet.Applet;

public class Zoom1 extends JApplet
private Image logo1;
private ImageIcon logo2;

public void init()
logo1 = getImage( getDocumentBase(),"image4.bmp");
logo2 = new ImageIcon("image4.bmp");

public void paint(Graphics g)
g.drawImage(logo1, 0, 0, this);
g.drawImage(logo1, 0, 120, getWidth(), getHeight() -120, this);

logo2.paintIcon(this, g, 180, 0);


public static void main(String []args)
Zoom1 zoom1 = new Zoom1();
JFrame frame = new JFrame("ShowZoom");

frame.setTitle("Show zoomed image in frame");
frame.setSize(600, 400);




No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on image not showing Or get search suggestion and latest updates.