Set image on Jlabel


         JFileChooser chooser = new JFileChooser();
        chooser.addChoosableFileFilter(new ImageFileFilter());
int returnVal = chooser.showOpenDialog(null);

if(returnVal == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
 path=file.getPath();
ImageIcon icon=new ImageIcon(path);
Jlabel jLabel1=new JLabel();
jLabel1.setIcon(icon);

Popular posts from this blog

Simple Sign up design. Android.

Cart page design in android.

Set Date on jDateChooser and retrieve record from database.