⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chuangkou.java

📁 JAVAQQ 聊天系统,信息发送.改变头像.等功能,时时聊天.
💻 JAVA
字号:
package com.li.myqq.login;


import javax.swing.JPanel;
import javax.swing.JFrame;

import java.awt.Toolkit;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import com.li.myqq.server.ServerThread;
import java.awt.Color;

import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;

import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JComboBox;
import java.awt.GridBagLayout;
import java.awt.FlowLayout;
import java.awt.Dimension;






public class Chuangkou extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JLabel jLabel = null;
    static Socket socket=null;

	public static String story;
     String xinxi[]=null;  //  @jve:decl-index=0:
	/**
	 * This is the default constructor
	 */
	public Chuangkou() {
		super();
		
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	ServerThread st=null;

	private JButton myfriend = null;

	private JButton select = null;

	private JButton menu = null;

	private JButton jButton = null;

	static public JLabel jLabel2 = null;

	static public  JLabel jLabel3 = null;

	static public JLabel jLabel4 = null;

	static public JLabel jLabel5 = null;

	private JScrollPane jScrollPane = null;

	public JPanel jPanel = null;

	@SuppressWarnings("deprecation")
	private void initialize() {
		this.setSize(188, 522);
		this.setResizable(false);
		this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/pic/84.gif")));
		this.setContentPane(getJContentPane());
		
		this.setVisible(true);
		int x=(int)Toolkit.getDefaultToolkit().getScreenSize().getWidth();
		int y=(int)Toolkit.getDefaultToolkit().getScreenSize().getHeight();
		int num1=(x-this.getWidth());
		int num2=(y-this.getHeight())-250;
		this.setLocation(num1, num2);
		String date=new SimpleDateFormat("yyyy-MM-dd  hh:mm").format(new Date()).toString();
	    Timer time=new Timer();
	     Date dt=new Date();
	  
	    getJButton().setText(date);
	   
				
				
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			
			jLabel5 = new JLabel();
			jLabel5.setBounds(new Rectangle(112, 44, 70, 21));
			jLabel5.setForeground(new Color(11, 40, 246));
			jLabel5.setText("");
			jLabel4 = new JLabel();
			jLabel4.setBounds(new Rectangle(48, 44, 64, 21));
			jLabel4.setForeground(new Color(249, 0, 46));
			jLabel4.setText("");
			jLabel3 = new JLabel();
			jLabel3.setBounds(new Rectangle(48, 21, 134, 24));
			jLabel3.setFont(new Font("\u96b6\u4e66", Font.ITALIC, 12));
			jLabel3.setForeground(new Color(197, 18, 238));
			jLabel3.setHorizontalAlignment(SwingConstants.LEFT);
			jLabel3.setText("");
			jLabel2 = new JLabel();
			
			jLabel2.setBounds(new Rectangle(1, 20, 47, 46));
			jLabel2.setIcon(new ImageIcon("./pic/10-1.gif"));
			jLabel2.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
			jLabel2.setHorizontalTextPosition(SwingConstants.CENTER);
			jLabel2.setVerticalAlignment(SwingConstants.CENTER);
			jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
			jLabel2.setText("");
			jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
				public void mouseClicked(java.awt.event.MouseEvent e) {
					UpdateMyInfo um=new UpdateMyInfo();
					um.setVisible(true);
					um.txtname.setText(getXinxi()[0]);
					um.jComboBox111.setSelectedIndex(Integer.parseInt(getXinxi()[4])-1);
					um.jComboBox1.setSelectedItem(getXinxi()[5]);
					String mm[]=getXinxi()[3].split("-");
					um.jComboBox.setSelectedItem(mm[0]);
					um.jComboBox11.setSelectedItem(mm[1]);
					um.getJTextArea().setText(getXinxi()[2]);
					um.email.setText(getXinxi()[6]);
				}
			});
			jLabel = new JLabel();
			jLabel.setBounds(new Rectangle(-2, -7, 183, 30));
			jLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
			jLabel.setIcon(new ImageIcon(getClass().getResource("/pic/qqqq.GIF")));
			jLabel.setText("");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(jLabel, null);
			jContentPane.setBackground(Color.cyan);
			jContentPane.add(getMyfriend(), null);
			jContentPane.add(getSelect(), null);
			jContentPane.add(getMenu(), null);
			jContentPane.add(getJButton(), null);
			jContentPane.add(jLabel2, null);
			jContentPane.add(jLabel3, null);
			jContentPane.add(jLabel4, null);
			jContentPane.add(jLabel5, null);
			jContentPane.add(getJScrollPane(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes myfriend	
	 * 	
	 * @return javax.swing.JButton	
	 */
	public JButton getMyfriend() {
		if (myfriend == null) {
			myfriend = new JButton();
			myfriend.setBounds(new Rectangle(-1, 65, 183, 27));
			myfriend.setBackground(new Color(43, 231, 31));
			myfriend.setText("我 的 好 友");
		}
		return myfriend;
	}

	/**
	 * This method initializes select	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getSelect() {
		if (select == null) {
			select = new JButton();
			select.setBounds(new Rectangle(93, 465, 88, 28));
			select.setBackground(new Color(14, 244, 246));
			select.setText("查  找");
			select.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					FriendSelect fs=new FriendSelect();
					fs.setVisible(true);
				}
			});
		}
		return select;
	}

	/**
	 * This method initializes menu	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getMenu() {
		if (menu == null) {
			menu = new JButton();
			menu.setBounds(new Rectangle(0, 465, 89, 32));
			menu.setBackground(new Color(17, 245, 247));
			menu.setText("菜  单");
		}
		return menu;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new Rectangle(0, 436, 182, 30));
			jButton.setBackground(new Color(20, 248, 250));
		}
		return jButton;
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setBounds(new Rectangle(1, 92, 182, 344));
			jScrollPane.setViewportView(getJPanel());
		}
		return jScrollPane;
	}

	/**
	 * This method initializes jPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	public JPanel getJPanel() {
		if (jPanel == null) {
			FlowLayout flowLayout = new FlowLayout();
			flowLayout.setHgap(50);
			flowLayout.setVgap(15);
			jPanel = new JPanel();
			jPanel.setPreferredSize(new Dimension(100, 150));
			jPanel.setBackground(new Color(23, 240, 209));
			jPanel.setLayout(flowLayout);
			
		}
		return jPanel;
	}

	public String[] getXinxi() {
		return xinxi;
	}

	 public void setXinxi(String[] xinxi) {
		this.xinxi = xinxi;
	}

}  //  @jve:decl-index=0:visual-constraint="46,2"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -