模仿QQhtml静态页面


使用html加css3动画完成模仿QQ静态页面,其中使用css3动画较多
资源截图
代码片段和文件信息
package org.vector.demo;

import java.awt.Font;
import java.awt.event.*;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.*;

public class chatBox {

private Jframe frame;
private JTextArea textArea1 textArea2;
private JButton button1 button2;
private JlayeredPane layeredPane = new JlayeredPane(); // 创建一个JlayeredPane用于分层的。
// 层次依次是:DEFAULTPALETTEMODALPOPUPDrag
private JLabel label1;
private ImageIcon image1;
private JScrollPane scpanel1 scpanel2;
SimpleDateFormat time = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss“);

public chatBox(String title String name) {
setframe(title);
setArea1(); // 信息记录
setArea2(); // 写信息
setButton1(name); // 发送按钮
setButton2(); // 关闭按钮
setQx(); // qq秀
}

/**
 * 框架
 * */
public void setframe(String title) {
frame = new Jframe();
frame.setBounds(300 100 1035 870);
frame.settitle(“与  “ + title + “  的聊天“);
frame.setlayeredPane(layeredPane); // 设置分层结构
frame.setResizable(false); // 设置不能改变框架大小
frame.setIconImage(new ImageIcon(“images/log.png“).getImage());// 任务栏图标
frame.setVisible(true);
}

/**
 * 消息记录
 * */
public void setArea1() {
textArea1 = new JTextArea();
scpanel1 = new JScrollPane(textArea1);
scpanel1.setBounds(0 0 850 650);
textArea1.setLineWrap(true); // 自动换行
textArea1.setFont(new Font(“楷书“ Font.PLAIN 24));
layeredPane.add(scpanel1 JlayeredPane.PALETTE_layer);
}

/**
 * 发送消息
 * */
public void setArea2() {
textArea2 = new JTextArea();
scpanel2 = new JScrollPane(textArea2);
textArea2.setLineWrap(true); // 自动换行
scpanel2.setBounds(0 660 850 130);
textArea2.setFont(new Font(“楷书“ Font.PLAIN 24));
layeredPane.add(scpanel2 JlayeredPane.PALETTE_layer);
}

/**
 * 发送按钮
 * */
public void setButton1(String name) {
button1 = new JButton(“发送“);
button1.setBounds(790 800 60 30);
button1.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (!(textArea2.getText().equals(““))) {
String s1 = time.format(new Date());
textArea1.append(name + “    “ + s1 + “
      “
+ textArea2.getText() + “
“);
textArea2.setText(““);
}
}
});
button1.setToolTipText(“Ctrl + Enter 发送消息         Enter换行“);
textArea2.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if ((e.getKeyCode() == KeyEvent.VK_ENTER) && (e.isControlDown() == true)) {
if (!(textArea2.getText().equals(““))) {
String s1 = time.format(new Date());
textArea1.append(name + “    “ + s1 + “
      “
+ textArea2.getText() + “
“);
textArea2.setText(““);
}
}
}
});

layeredPane.add(button1 JlayeredPane.DEFAULT_layer);
}

/**
 * 关闭按钮
 * */
public void setButton2() {
button2 = new JButton(“关闭“);
button2.setBounds(710 800 60 30);
button2.addMouseListener(new MouseAdapter() {
public void mouseClicked

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-10-11 10:31  files
     文件           6  2018-11-17 12:03  filesqqKey.txt
     文件           6  2018-11-17 12:03  filesqqName.txt
     文件          26  2018-11-17 12:03  filesqqNum.txt
     文件         701  2018-10-11 10:26  filesqqSpace
     目录           0  2018-10-11 10:31  images
     文件      478287  2018-10-10 13:25  images000.png
     文件       55695  2018-10-10 13:25  images1.png
     文件       62015  2018-10-10 13:25  images10.jpg
     文件       11893  2018-10-10 13:25  images2.jpg
     文件       18304  2018-10-10 13:25  images23.gif
     文件        3107  2018-10-10 13:25  images3.png
     文件     2579339  2018-10-10 13:25  imagesBackground.gif
     文件        4481  2018-10-10 13:25  imageslack.png
     文件         533  2018-10-10 13:25  imagesclose.png
     文件         895  2018-10-10 13:25  imagescode.png
     文件     1414581  2018-10-10 13:25  imagesdiaLog.gif
     文件         431  2018-10-10 13:25  imageskey.png
     文件        4392  2018-10-10 13:25  imageslog.png
     文件        3415  2018-10-10 13:25  imageslogin.PNG
     文件        2925  2018-10-10 13:25  imagesmini.png
     文件        3191  2018-10-10 13:25  imagesmini0.png
     文件        3525  2018-10-10 13:25  imagesok.png
     文件       23710  2018-10-10 13:25  imagespenguin.png
     文件       10288  2018-10-10 13:25  imagesqqCode.png
     文件      101983  2018-10-10 13:25  images
eB.png
     文件        3130  2018-10-10 13:25  images
eturn.png
     文件        5946  2018-10-10 13:25  imageswhite.png
     文件         561  2018-10-10 13:25  imagesxqq.png
     文件       50690  2018-10-11 10:33  QQ.jar
     目录           0  2018-11-17 12:14  QQ_Demo
............此处省略94个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)