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 ); } } } }