因为图片发不了 我做了附件请大家帮忙看下!
我想把附件里面 1 的那个登录窗口 做成和2 一样
大家看了图片后------ 我的意思是 也想做个象2一样的用户登录的 LOGO 图片进去 当然标题我也想该成登录 我自己的标题是 Frame Title
实在不知道怎么弄来问问大家~!
请问大家怎么做? 需要加什么代码?怎么该! 以下是我这个窗口的代码!
package project;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Register extends JFrame {
JPanel contentPane;
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JButton Denglu = new JButton();
JTextField usersName = new JTextField();
JTextField usersPwd = new JTextField();
JLabel jLabel3 = new JLabel();
JButton registers = new JButton();
public Register() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(400, 330));
setTitle("Frame Title");
jLabel1.setText("用户名");
jLabel1.setBounds(new Rectangle(31, 77, 60, 37));
jLabel2.setText("密码");
jLabel2.setBounds(new Rectangle(31, 140, 60, 37));
Denglu.setBounds(new Rectangle(48, 233, 89, 39));
Denglu.setText("登录");
Denglu.addActionListener(new Register_Denglu_actionAdapter(this));
usersName.setBounds(new Rectangle(143, 75, 177, 39));
usersPwd.setBounds(new Rectangle(143, 140, 177, 39));
jLabel3.setFont(new java.awt.Font("华文新魏", Font.PLAIN, 30));
jLabel3.setText(" 图书管理系统");
jLabel3.setBounds(new Rectangle(35, 0, 264, 61));
registers.setBounds(new Rectangle(197, 233, 94, 38));
registers.setText("注册");
registers.addMouseListener(new Register_jButton1_mouseAdapter(this));
contentPane.add(Denglu);
contentPane.add(jLabel2);
contentPane.add(usersName);
contentPane.add(jLabel1, null);
contentPane.add(usersPwd);
contentPane.add(jLabel3);
contentPane.add(registers);
}
public void Denglu_actionPerformed(ActionEvent e) {
}
public void jButton1_mouseClicked(MouseEvent mouseEvent) {
}
}
class Register_jButton1_mouseAdapter extends MouseAdapter {
private Register adaptee;
Register_jButton1_mouseAdapter(Register adaptee) {
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent mouseEvent) {
adaptee.jButton1_mouseClicked(mouseEvent);
}
}
class Register_Denglu_actionAdapter implements ActionListener {
private Register adaptee;
Register_Denglu_actionAdapter(Register adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.Denglu_actionPerformed(e);
}
}