dangsn
2024-12-26 4e9ff2ce6a830bb2340d7c8612c72eea0c5a553e
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
59
package com.vci.client.logon.client;
 
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
 
import javax.swing.ImageIcon;
 
import com.vci.client.ui.image.BundleImage;
import com.vci.client.ui.swing.VCIOptionPane;
 
import netscape.javascript.JSObject;
 
public class LogonAppletPanel extends LogonPanel{
 
    /**
     * 
     */
    private static final long serialVersionUID = 175664534804092016L;
    JSObject win = null;
    ImageIcon image = null;
 
    public LogonAppletPanel(Frame frame, int iTag, JSObject win, ImageIcon image) {
        super(frame, iTag);
        this.win = win;
        this.image = image;
    }
 
    public void logonButton_actionPerformed(ActionEvent e) {
        try {
            if(checkInput()){
                logonButton.setEnabled(false);
                String userName = getUserName();
                String password = getPassword();
                loginLabel.setIcon(new BundleImage().createImageIcon ("login.gif"));
                LogonAppletThread loginThread = new LogonAppletThread(win, userName, password, this.psText, this);
                loginThread.start();
            } else {
                logonButton.setEnabled(true);
                clearLoadingIcon();
            }
        } catch (Exception exp) {
            VCIOptionPane.showError(this, exp.getMessage());
            return;
        }
    }
    
    protected void paintComponent(Graphics g) {
        setOpaque(true);
        super.paintComponent(g);
        Dimension d = getSize();
        for(int x = 0; x < d.width; x += image.getIconWidth()) {
            for(int y = 0; y < d.height; y += image.getIconHeight()) {
                g.drawImage( image.getImage(), x, y, image.getIconWidth(), image.getIconHeight(), null, null );
            }
        } 
    }
}