Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
this is the code

class ImgPanel extends JPanel{
public void paintComponent(Graphics g){
Image img=new ImageIcon("test/19.jpeg").getImage();
g.drawImage(img, 0, 0, this);
}
}


and here is the question....
in which folder sould I put the jpg file so this code works??
Posted

1 solution

There has to be a folder named "test" on the same level as your bin and src folders. Just put the 19.jpeg into it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900