hi,
i add an image for a frame ,that image was in my drive.now i need to run the frame in another computer ,but in that the image was not readable.how to choose the image for my frame to runn it anywhere
import java.lang.Thread;
public class welcome extends javax.swing.JFrame
{
int num;
public welcome()
{
initComponents();
setLocationRelativeTo(null);
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents()
{
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.JFrame.EXIT_O N_CLOSE);
setTitle("Welcome");
setLocationByPlatform(true);
setResizable(false);
jLabel1.setIcon(new javax.swing.ImageIcon("J:\\project\\tiens\\tiens\\welcome.JPG")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 617, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 445, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
public static void main(String args[])
{
try{
welcome w=new welcome();
w.setVisible(true);
java.lang.Thread.sleep(1000);
loading l=new loading();
l.setVisible(true);
l.iterate();
w.setVisible(false);
}catch(Exception e){}
}
private javax.swing.JLabel jLabel1;
}