⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 beandemo.java

📁 里面所含源码是本人平时做程序的一些实例
💻 JAVA
字号:
package JSwingDemo;

import java.awt.*;
import java.beans.*;

import javax.swing.*;

public class BeanDemo extends JPanel {
    BorderLayout borderLayout1 = new BorderLayout();
    private int userId;
    private String tel;
    private transient PropertyChangeSupport propertyChangeListeners = new
            PropertyChangeSupport(this);
    public BeanDemo() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        setLayout(borderLayout1);
    }

    public void setBorderLayout1(BorderLayout borderLayout1) {
        this.borderLayout1 = borderLayout1;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public void setTel(String tel) {
        String oldTel = this.tel;
        this.tel = tel;
        propertyChangeListeners.firePropertyChange("tel", oldTel, tel);
    }

    public BorderLayout getBorderLayout1() {
        return borderLayout1;
    }

    public int getUserId() {
        return userId;
    }

    public synchronized void removePropertyChangeListener(
            PropertyChangeListener l) {
        super.removePropertyChangeListener(l);
        propertyChangeListeners.removePropertyChangeListener(l);
    }

    public synchronized void addPropertyChangeListener(PropertyChangeListener l) {
        super.addPropertyChangeListener(l);
        propertyChangeListeners.addPropertyChangeListener(l);
    }

    public String getTel() {
        return tel;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -