PHP Code:
import javax.swing.*;
import java.awt.*;
public class ImageDraw extends JFrame
{
public ImageDraw()
{
super("");
setSize(300, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args){new ImageDraw();}
}
class ImagePanel extends JPanel
{
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Image im = new ImageIcon("image.jpg").getImage();
g.drawImage(im, 0, 0, null);
}
}
the code above id a dumb code for placing an "image.jpg" onto the program...
somewhy it doesn't work...
I also tried using Toolkit.getDefaultToolkit().getImage() but it doesn't work(although when i checked it's getWidth, getHeight methods, they returned -1...<<error).
thanks ahead of time... images are a big part of making... anything
i know i can use bufferedimage but that's longer code...