Miletone

Rp0 / Rp1.000.000

Showing posts with label [JAVA] How to JTable Click to JTextField. Show all posts
Showing posts with label [JAVA] How to JTable Click to JTextField. Show all posts

Sunday, September 29, 2019

[JAVA] How to JTable Click to JTextField

Click Right on the table, selecr mouse, select and click mouseclicked then you fill code :
try{
            int Linha = jTable1.getSelectedRow();
            nik.setText(jTable1.getValueAt(Linha, 0).toString());
            transnik.setText(jTable1.getValueAt(Linha, 0).toString());
            nama.setText(jTable1.getValueAt(Linha, 1).toString());
            ttl.setText(jTable1.getValueAt(Linha, 2).toString());
            daerahasal.setText(jTable1.getValueAt(Linha, 3).toString());
            asalkiriman.setText(jTable1.getValueAt(Linha, 4).toString());
            /**Blob filenameBlob = (Blob) (jTable1.getValueAt(Linha, 6));
            byte[] content = filenameBlob.getBytes(1L,(int)filenameBlob.length());
            if(jTable1.getValueAt(Linha, 6) !=null){
                ImageIcon image = new ImageIcon(content);
                Image image1 = image.getImage().getScaledInstance(FOTO.getWidth(), FOTO.getHeight(), Image.SCALE_SMOOTH);
                ImageIcon image2 = new ImageIcon(image1);
                FOTO.setIcon(image2);
            }**/
        } catch (Exception e){

        }