Listingcode membuat Password Di netbeens
Frame 1. Username dan Password
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
if(jTextField1.getText().equals("admin") &&
jPasswordField1.getText().equals("12345")) {
new NewJFrame1().show();
this.dispose();
}
else{
JOptionPane.showMessageDialog(null,
"Maaf, Username dan Password salah", "Error Dialog", JOptionPane.INFORMATION_MESSAGE);
jTextField1.setText("");
jPasswordField1.setText("");
}
}
Frame 2. Halaman Utama
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int nilai1;
int nilai2;
int nilai3;
String hasil;
nilai1=Integer.valueOf(jTextField1.getText());
nilai2=Integer.valueOf(jTextField2.getText());
nilai3=nilai1+nilai2;
hasil=String.valueOf(nilai3);
jLabel3.setText(hasil);
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText(" ");
jTextField2.setText(" ");
jLabel3.setText(" ");
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.dispose();
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
new NewJFrame().show();
this.dispose();
}
Belum ada tanggapan untuk "Listingcode membuat Password Di netbeens"
Post a Comment