wangting
2024-12-26 fa261e8c1220b31af54e8167e4de9c3320b1af27
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
package com.vci.client;
 
import java.awt.Container;
import java.awt.Frame;
import java.net.URL;
 
import javax.swing.ImageIcon;
import javax.swing.JApplet;
 
import com.vci.client.logon.client.LogonAppletPanel;
import com.vci.client.ui.swing.VCISwingUtil;
 
import netscape.javascript.JSObject;
 
public class LogonApplet extends JApplet {
 
    /**
     * 
     */
    private static final long serialVersionUID = 5144731081715551975L;
 
    public void init() {
        try {
            // NimbusLookAndFeel
            //VCISwingUtil.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            //VCISwingUtil.setLookAndFeel(VCISwingUtil.LOOK_AND_FEEL_NimbusLookAndFeel);
            VCISwingUtil.setLookAndFeel();
            JSObject win = (JSObject) JSObject.getWindow(this);
            URL url = getClass().getResource("/picture/login.gif");
            LogonAppletPanel logonPanel = new LogonAppletPanel(getFrame(), 0, win, new ImageIcon(url));
            this.setContentPane(logonPanel);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    public Frame getFrame() {
        Container c = this.getParent();
        while (c != null) {
            if (c instanceof Frame) {
                return (Frame) c;
            }
            c = c.getParent();
        }
        return null;
    }
}