当前位置: 代码迷 >> Java相关 >> 界面问题!
  详细解决方案

界面问题!

热度:365   发布时间:2006-08-07 22:41:48.0
界面问题!

因为图片发不了 我做了附件请大家帮忙看下!

我想把附件里面 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);
}
}


搜索更多相关的解决方案: 界面  

----------------解决方案--------------------------------------------------------
还有呢 我这第一个窗口的名字叫 Register
我想在点下注册按扭的时候 跳转到 另外一个窗口应该怎么弄?
我另一个窗口名字叫 winRegister

先谢谢了~!
----------------解决方案--------------------------------------------------------
  相关解决方案