Java Swing仿QQ登录界面 学习之用
闲来无事将早些时候已实现的QQ登录界面再实现了一遍,纯手工打造(意思是没有用NetBeans、MyEclipse的拖动功能)。
源代码如下:
package ibees.qq;
import java.awt.BorderLayout;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
/**
* 仿QQ登录界面,仅供学习参考,涉及到的有窗口居中、JPanel、LayoutManager的使用
* @author hhzxj2008
* */
public class QQLoginView extends JFrame {
/**
*
*/
private static final long serialVersionUID = -5665975170821790753L;
public QQLoginView() {
initComponent();
}
private void initComponent() {
setTitle("用户登录");
//设置LOGO
URL image = QQLoginView.class.getClassLoader().getResource("ibees/qq/images/year.jpg");//图片的位置
JLabel imageLogo = new JLabel(new ImageIcon(image));
add(imageLogo,BorderLayout.NORTH);
//QQ号和密码
JPanel jp = new JPanel();
JPanel jpAccount = new JPanel();
jpAccount.add(new JLabel("帐号"));
JTextField userTextField = new JTextField(15);
jpAccount.add(userTextField);
jpAccount.add(new JLabel("用户注册"));
jp.add(jpAccount);
JPanel jpPass = new JPanel();
jpPass.add(new JLabel("密码"));
JPasswordField passTextField = new JPasswordField(15);
jpPass.add(passTextField);
jpPass.add(new JLabel("找回密码"));
jp.add(jpPass);
//登录设置
JPanel jpstatus = new JPanel();
jpstatus.add(new JLabel("状态"));
JComboBox statusComboBox = new JComboBox();
statusComboBox.addItem("Q我");
statusComboBox.addItem("在线");
statusComboBox.addItem("隐身");
statusComboBox.addItem("离线");
jpstatus.add(statusComboBox);
jpstatus.add(new JCheckBox("记住密码"));
jpstatus.add(new JCheckBox("自动登录"));
jp.add(jpstatus);
add(jp);
//底部登录按钮
JPanel bottomPane
相关文档:
public class Multiplication
{
public static void main(String[] args)
{
// TODO Auto-generated method stub
for(int i = 1; i < 10; i+ ......
服务器端:
package com.huahua;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class ServerThread extends Thread {
......
Java编写一个函数交换两个变量的值
Java函数在传递过程中只能够传值,不能传址。这样,函数的参数在函数内部做任何变化就都不会反映到外部调用者来。所以解决之道就是要找到要交换对象的引用。对于普通的值类型,像int或者double这样的可以改传他们的包装类Integer和Double。而对于本来就是引用类型的对象,则需要对他们再 ......
PROCEDURE user_Login (
i_AuthID IN user_UserPass.UserID%TYPE, --用户代码
i_FunctionCode IN &n ......
刚才看见群里的一个朋友在问队列的使用,确实在现实的写代码中很少使用队列的,反正我是从来没使用过。只是学数据结构的时候学过。
下面是我写的一个小例子,希望有不足之处请提出改正。O(∩_∩)O~
看代码:
import java.util.LinkedList;
import java.util.Queue;
public class TestQueue
{
/**
* @param ......