/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.java.myapp;
import javax.swing.JOptionPane;
/**
*
* @author WEERACHAI
*/
public class MyFormApp extends javax.swing.JFrame {
/**
* Creates new form MyFormApp
*/
public MyFormApp() {
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">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
txtName = new javax.swing.JTextField();
btnClick = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(null);
jLabel1.setText("Welcome to ThaiCreate.Com");
getContentPane().add(jLabel1);
jLabel1.setBounds(120, 60, 140, 14);
txtName.setName("txtName"); // NOI18N
getContentPane().add(txtName);
txtName.setBounds(70, 100, 260, 20);
btnClick.setText("Click");
btnClick.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnClickActionPerformed(evt);
}
});
getContentPane().add(btnClick);
btnClick.setBounds(150, 140, 90, 23);
pack();
}// </editor-fold>
private void btnClickActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(this, "Sawatdee : " + txtName.getText());
}
/**
* @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(MyFormApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MyFormApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MyFormApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MyFormApp.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 MyFormApp().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btnClick;
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField txtName;
// End of variables declaration
}