APLIKASI PENDAFTARAN WORKSHOP
gambar design awal
Aplikasi ini untuk mendaftarkan diri mengikuti Workshop dan memesan tiket secara online. Data diri yang sudah di input akan diproses setelah me-ngeklik "Ok" dan "Clear" untuk menghapus data untuk memulai dari awal.
source code:
Radio button:
private void nmActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void emailActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void dllActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
tampilkanprofesi();
}
Check box:
private void tampilkanprofesi(){
StringBuffer profesi=new StringBuffer();
if (pljr.isSelected()==true){
profesi.getClass();
guru.setEnabled(false);
dll.setEnabled(false);
}
else if(guru.isSelected()){
profesi.getClass();
pljr.setEnabled(false);
dll.setEnabled(false);
}
else if (dll.isSelected()){
profesi.getClass();
pljr.setEnabled(false);
guru.setEnabled(false);
}
}
private void profesiActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void pljrActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
tampilkanprofesi();
}
private void guruActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
tampilkanprofesi();
}
Combo box:
private void formWindowActivated(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
for (int u=1; u<=4; u++){
jumlah.addItem(""+u);
}
}
private void jumlahActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if (jumlah.getSelectedItem().equals("1")){
hrg.setText("20000");
}
if (jumlah.getSelectedItem().equals("2")){
hrg.setText("40000");
}
if (jumlah.getSelectedItem().equals("3")){
hrg.setText("60000");
}
if (jumlah.getSelectedItem().equals("4")){
hrg.setText("80000");
}
}
Button Ok:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(rootPane, "Terimakasih sudah mendaftar");
}
Button Clear:
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
nm.setText("");
email.setText("");
almt.setText("");
lk.setSelected(false);
pr.setSelected(false);
pljr.setSelected(false);
guru.setSelected(false);
dll.setSelected(false);
pljr.setEnabled(true);
guru.setEnabled(true);
dll.setEnabled(true);
profesi.setText("");
no.setText("");
jumlah.setSelectedIndex(0);
hrg.setText("");
}
/**
* @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(aplikasipendaftaran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(aplikasipendaftaran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(aplikasipendaftaran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(aplikasipendaftaran.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new aplikasipendaftaran().setVisible(true);
}
});
}
gambar setelah di running
Komentar
Posting Komentar