|
|
|
รบกวนผู้รู้ช่วยเขียนโค๊ตนี้ให้ผมหน่อยครับ ขอบคุณมากครับ Java GUI |
|
|
|
|
|
|
|
package exam3;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class calculateGrade {
private JFrame frame;
private JTextField textField;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
calculateGrade window = new calculateGrade();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public calculateGrade() {
initialize();
}
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 477, 264);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JLabel lblEnterScore = new JLabel("Enter Score : ");
lblEnterScore.setBounds(55, 75, 125, 20);
frame.getContentPane().add(lblEnterScore);
textField = new JTextField();
textField.setBounds(167, 72, 146, 26);
frame.getContentPane().add(textField);
textField.setColumns(10);
JButton btnSubmit = new JButton("Submit");
/*
ActionListener อยู่ตรงนี้
*/
btnSubmit.setBounds(167, 131, 115, 29);
frame.getContentPane().add(btnSubmit);
}
}
Code form ครับ
|
|
|
|
|
Date :
2020-01-31 11:35:40 |
By :
ball2556 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|