帮忙编译java程序:

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:13:47
谢谢,设计并实现一个应用程序,为用户显示两个按钮和一个标签。标注按钮为增大减小。使用标签显示一个数值(初始50)每当按下增加按钮时所显示的数增加。按减小则减小

public class Text extends javax.swing.JFrame {
public Text() {
initComponents();
this.setTitle("加减程序");
}
private void initComponents() {

jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();

setDefaultCloseOperation(3);

jLabel1.setName("jLabel1");
jLabel1.setText("50");

jButton1.setText("\u589e\u5927");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jButton2.setText("\u51cf\u5c0f");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});