|
jframe
F:\a\a\res\
contains all the5 .png files of different color names red blue ............
and i just written a program
import javax.swing.*;
import java.awt.*;
class q
{
public void static void main(String args[])
{
JFrame w=new JFrame();
Container c=getContentpane();
//iam loding image form res folder
Image r=getImage(getCodeBase(),"red.png");
c.add(r);
w.add(c);
}
}
it is giving me error and it is not showing my images in the jframe
plz tell me how to add images in a jframe but dont make complicated it with buffered io or image.io plz tell me in a simple manner tell me in a simple manner in a jframe or jpanel or swings and also i just want 4 out 5 images to placed in random order whenever i execute the application
|