import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import sun.audio.*;
import java.io.*;
class LoadIn extends JDialog
{
//WarningDialog warDia=new WarningDialog();
JButton confirm,cancel;
JTextField User_Name;
JPasswordField User_Code;
boolean IsLoad=false;
ImageIcon Picture=new ImageIcon("picture.jpg");
ImageIcon ok=new ImageIcon("ook.png");
JLabel top_Icon=new JLabel(Picture);
JLabel show_Name,show_Code;
JPanel top,center,bottom;
JPanel pic=new JPanel();
JPanel name=new JPanel();
JPanel code=new JPanel();
JPanel btn=new JPanel();
LoadIn()
{
Container contentPane=this.getContentPane();
contentPane.setLayout(new BorderLayout());
pic=new JPanel(new FlowLayout(FlowLayout.CENTER));
pic.add(top_Icon);
confirm=new JButton(ok);
confirm.setToolTipText("登陆"); //设置提示文字
confirm.setLayout(null);
confirm.setSize(ok.getIconHeight(),ok.getIconWidth());
cancel=new JButton("CANCEL");
cancel.setToolTipText("退出");
User_Name=new JTextField(15);
User_Code=new JPasswordField(15);
show_Name=new JLabel("用户名:");
name=new JPanel(new FlowLayout(FlowLayout.CENTER));
name.add(show_Name);
name.setToolTipText("输入用户名");
name.add(User_Name);
show_Code=new JLabel("密 码:");
code=new JPanel(new FlowLayout(FlowLayout.CENTER));
code.add(show_Code);
code.setToolTipText("输入密码");
code.add(User_Code);
btn=new JPanel(new FlowLayout(FlowLayout.CENTER));
btn.add(confirm);
btn.add(cancel);
center=new JPanel();
center.setLayout(new GridLayout(2,1));
center.add(name);
center.add(code);
top=new JPanel();
top.add(pic);
bottom=new JPanel();
bottom.add(btn);
contentPane.add(top,"North");
contentPane.add(center,"Center");
contentPane.add(bottom,"South");
User_Code.setEchoChar('*');
setVisible(true);
setSize(400,330);
validate();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
class MainFrame extends JFrame
{
public static void main (String[] args)
{
new LoadIn();
}
}