ludc
2024-09-14 36c2449aec5b51e5ed4e5c6841154b746060e09a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.vci.client.ui.swing;
 
import javax.swing.JButton;
 
import com.vci.client.ui.image.BundleImage;
 
public class KJButton extends JButton{
    
    /**
     *  带图标的JButton
     */
    private static final long serialVersionUID = 1L;
    private Object obj = null;
    private String actionCode = "";
    private BundleImage bundleImage = new BundleImage();
    public KJButton(String text , String icon , Object obj) {
        this(text, icon);
        this.obj = obj;
    }
    public KJButton(String text , String icon , Object obj, String actionCode) {
        this(text, icon, obj);
        this.actionCode = actionCode;
    }
    public KJButton() {
        super();
    }
    
    public KJButton(String text , String icon) {
        this(text);
        setIcon(icon);
    }
    
    public KJButton(String text) {
        super(text);
    }
    
    public void setIcon(String icon){
        if(icon.length() != 0 && !icon.equals("")){
            this.setIcon(bundleImage.createImageIcon(icon));
        }
    }
 
    public Object getObj() {
        return obj;
    }
 
    public void setObj(Object obj) {
        this.obj = obj;
    }
 
    public String getActionCode() {
        return actionCode;
    }
 
    public void setActionCode(String actionCode) {
        this.actionCode = actionCode;
    }
}