java中添加一个事件_java事件的添加

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

谢谢你   我想知道这个代码每一行都是手写的吗 我的意思是说用NetBeans直接添加事件 只要少写一小部分代码就可了 手写的代码怎么添加 下面是我用NetBeans画出界面生成的原代码: (希望能懂我的意思 呵呵)

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

/*

* NewJFrame.java

*

* Created on 2010-5-7, 13:52:11

*/

package Frame;

/**

*

* @author user

*/

public class NewJFrame extends javax.swing.JFrame {

/** Creates new form NewJFrame */

public NewJFrame() {

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")

//

private void initComponents() {

jPasswordField2 = new javax.swing.JPasswordField();

jTextField2 = new javax.swing.JTextField();

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

jButton1 = new javax.swing.JButton();

jTextField1 = new javax.swing.JTextField();

jButton2 = new javax.swing.JButton();

org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(desktopapplication4.DesktopApplication4.class).getContext().getResourceMap(NewJFrame.class);

jPasswordField2.setText(resourceMap.getString("jPasswordField2.text")); // NOI18N

jPasswordField2.setName("jPasswordField2"); // NOI18N

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

setName("Form"); // NOI18N

jTextField2.setText(resourceMap.getString("jTextField2.text")); // NOI18N

jTextField2.setName("jTextField2"); // NOI18N

jTextField2.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值