|
icon
JFrame q=new JFrame( " Game");
ImageIcon c=new ImageIcon("red.png");
ImageIcon d=new ImageIcon("blue.png");
JLabel l= new JLabel(c);
JLabel j=new JLabel(d);
l.setBounds(50,50,90,50);
j.setBounds(100,50,90,50);
q.getContentPane().add(l);
q.getContentPane().add(j);
q.setVisible(true);
i just place in main it is executing correctly but i just want to get "red.png" (x,y,width,height) does there is any method AND also i just want to generate these icons in random order but how there are named as c,d how can i generate them
|