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

Jtable with database manually in netbeans.

Join in Kotlin coroutines