private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        FileNameExtensionFilter ff2 = new FileNameExtensionFilter(".bmp",".JPG","PNG", "bmp","JPG","PNG");
        jf.setFileFilter(ff2);
        int l = jf.showOpenDialog(null);
        if (l == jf.APPROVE_OPTION) {

            alamatgambardwt = jf.getSelectedFile().getPath();//mendapatkan url gambar dari pemilihan Jfile chooser
            dapatkangambardariurl(alamatgambardwt);
//            namaFile = jf.getName();//mendapatkan nama file dari URL
//            System.out.print(namaFile);

            BufferedImage igmbr = loadimage(alamatgambardwt);

            int pn = igmbr.getHeight();//mengetahui panjang gambar
            int lb = igmbr.getWidth();//mengetahui lebar gambar

            if (pn <= 200 || lb < 200) {
                JOptionPane.showMessageDialog(null, " masukkan gambar minimal ukuran 200 X 200 Px","ERROR",JOptionPane.ERROR_MESSAGE);
                //reset();
            } else if (pn > 1024 || lb > 1024) {
                JOptionPane.showMessageDialog(null, " masukkan gambar maximal ukuran 1024 X 1024 Px","ERROR",JOptionPane.ERROR_MESSAGE);
                //reset();
            } else if( pn != lb){
                JOptionPane.showMessageDialog(null, "anda harus memasukkan gambar dalam ukuran persegi","ERROR",JOptionPane.ERROR_MESSAGE);
            } else {

                ImageIcon imii = new ImageIcon(resize(igmbr, lblgambaresktrak.getWidth(), lblgambaresktrak.getHeight()));
                lblgambaresktrak.setIcon(imii);
            }

        }
    }//GEN-LAST:event_jButton1ActionPerformed