import java.awt.*;
import javax.swing.*;
class ph extends JPanel
{
public void paintComponent(Graphics g)
{
Image image=new ImageIcon("honda-bikes-42a (1).jpg").getImage();
g.drawImage(image,3,4,this);
}
}
public class photo {
public static void main(String[] args)
{
JFrame frame=new JFrame();
frame.getContentPane().add(new ph());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800,800);
frame.setVisible(true);
}
}
import javax.swing.*;
class ph extends JPanel
{
public void paintComponent(Graphics g)
{
Image image=new ImageIcon("honda-bikes-42a (1).jpg").getImage();
g.drawImage(image,3,4,this);
}
}
public class photo {
public static void main(String[] args)
{
JFrame frame=new JFrame();
frame.getContentPane().add(new ph());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800,800);
frame.setVisible(true);
}
}
No comments:
Post a Comment