private void formWindowActivated( java.awt.event.WindowEvent evt) { // GEN-FIRST:event_formWindowActivated try { getDataURL dataurl = new getDataURL(); String UID = this.getTitle(); String url_username = "******" + UID + "&select_field=username&from_table=user"; String data_username = dataurl.getData(url_username); String url_realname = "http://localhost/uangku/?op=get&from_data=uid&value_data=" + UID + "&select_field=realname&from_table=user"; String data_realname = dataurl.getData(url_realname); String url_lastlogin = "******" + UID + "&select_field=lastlogin&from_table=user"; String data_lastlogin = dataurl.getData(url_lastlogin); String url_lastupdate = "http://localhost/uangku/?op=get&from_data=uid&value_data=" + UID + "&select_field=u_at&from_table=user"; String data_lastupdate = dataurl.getData(url_lastupdate); System.out.println("GET DATA ----------------------------------------"); System.out.println("UID: " + UID); System.out.println("username: "******"realname: " + data_realname); System.out.println("lastlogin: "******"lastupdate: " + data_lastupdate); System.out.println("----------------------------------------"); Tusername.setText(data_username); Trealname.setText(data_realname); Llastlogin.setText(data_lastlogin); Llastupdate.setText(data_lastupdate); Luid.setText(this.getTitle()); this.setTitle("Uangku - " + data_realname); } catch (IOException ex) { Logger.getLogger(FormData.class.getName()).log(Level.SEVERE, null, ex); } } // GEN-LAST:event_formWindowActivated
private void BsaveMouseClicked( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_BsaveMouseClicked String UID = Luid.getText(); String username = Tusername.getText(); String realname = Trealname.getText(); String password_text = Tpassword.getText(); String password; password = DigestUtils.md5Hex(password_text); String url = "http://localhost/uangku/?op=updateuser&uid=" + UID + "&username="******"&password="******"&realname=" + realname; System.out.println(url); } // GEN-LAST:event_BsaveMouseClicked
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT * modify this code. The content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); Tusername = new javax.swing.JTextField(); Trealname = new javax.swing.JTextField(); Llastlogin = new javax.swing.JLabel(); Llastupdate = new javax.swing.JLabel(); Tpassword = new javax.swing.JPasswordField(); jLabel8 = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); jSeparator2 = new javax.swing.JSeparator(); Bsave = new javax.swing.JButton(); Bcancel = new javax.swing.JButton(); Luid = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener( new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } }); jLabel1.setText("Nama pengguna"); jLabel2.setText("Nama lengkap"); jLabel3.setText("Terakhir masuk"); jLabel4.setText("Kata sandi"); jLabel5.setText("Terakhir diubah"); Llastlogin.setText("last_login"); Llastupdate.setText("last_updated"); jLabel8.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel8.setText("Pengaturan Pengguna"); Bsave.setText("Simpan"); Bsave.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { BsaveMouseClicked(evt); } }); Bcancel.setText("Batal"); Bcancel.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { BcancelMouseClicked(evt); } }); Luid.setText("UID"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addComponent(jLabel1) .addComponent(jLabel4) .addComponent(jLabel3) .addComponent(jLabel5) .addComponent(jLabel2)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addComponent(Tusername) .addComponent(Trealname) .addComponent( Llastlogin, javax.swing.GroupLayout .DEFAULT_SIZE, javax.swing.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( Llastupdate, javax.swing.GroupLayout.Alignment .TRAILING, javax.swing.GroupLayout .DEFAULT_SIZE, javax.swing.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Tpassword))) .addComponent(jSeparator1) .addComponent( jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addComponent(Luid) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Bsave) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Bcancel) .addGap(14, 14, 14))))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(16, 16, 16) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent( Tusername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent( Trealname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent( Tpassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(Llastlogin)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(Llastupdate)) .addGap(18, 18, 18) .addComponent( jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Bsave) .addComponent(Bcancel)) .addContainerGap()) .addGroup( layout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Luid) .addContainerGap( javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))); pack(); } // </editor-fold>//GEN-END:initComponents