Contact
Contact
Contact
JOptionPane;
import javax.swing.table.DefaultTableModel;
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to
change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this
template
*/
/**
*
* @author Asus
*/
public class Aplikasi extends javax.swing.JFrame {
/**
* Creates new form Aplikasi
*/
public Aplikasi() {
initComponents();
}
/**
* 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">
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextFieldName.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextFieldNameActionPerformed(evt);
}
});
jTextFieldEmail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextFieldEmailActionPerformed(evt);
}
});
jComboBoxKategori.setModel(new javax.swing.DefaultComboBoxModel<>(new
String[] { "friend", "Family", "Work" }));
jComboBoxKategori.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxKategoriActionPerformed(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Name", "Phone", "Email", "Kategori"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.Integer.class,
java.lang.String.class, java.lang.String.class
};
jTextFieldPhone.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextFieldPhoneActionPerformed(evt);
}
});
jLabel1.setText("Name");
jLabelPhone.setText("Phone");
jLabel3.setText("Email");
jButtonSave.setText("Save");
jButtonSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonSaveActionPerformed(evt);
}
});
pack();
}// </editor-fold>
jTextFieldName.setText("");
jTextFieldPhone.setText("");
jTextFieldEmail.setText("");
jComboBoxKategori.setSelectedIndex(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Aplikasi.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Aplikasi.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Aplikasi.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Aplikasi.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
}
//</editor-fold>