资源简介
使用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 + “\n “
+ textArea2.getText() + “\n“);
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 + “\n “
+ textArea2.getText() + “\n“);
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 files\qqKey.txt
文件 6 2018-11-17 12:03 files\qqName.txt
文件 26 2018-11-17 12:03 files\qqNum.txt
文件 701 2018-10-11 10:26 files\qqSpace
目录 0 2018-10-11 10:31 images\
文件 478287 2018-10-10 13:25 images\0000.png
文件 55695 2018-10-10 13:25 images\1.png
文件 62015 2018-10-10 13:25 images\10.jpg
文件 11893 2018-10-10 13:25 images\2.jpg
文件 18304 2018-10-10 13:25 images\23.gif
文件 3107 2018-10-10 13:25 images\3.png
文件 2579339 2018-10-10 13:25 images\Background.gif
文件 4481 2018-10-10 13:25 images\black.png
文件 533 2018-10-10 13:25 images\close.png
文件 895 2018-10-10 13:25 images\code.png
文件 1414581 2018-10-10 13:25 images\diaLog.gif
文件 431 2018-10-10 13:25 images\key.png
文件 4392 2018-10-10 13:25 images\log.png
文件 3415 2018-10-10 13:25 images\login.PNG
文件 2925 2018-10-10 13:25 images\mini.png
文件 3191 2018-10-10 13:25 images\mini0.png
文件 3525 2018-10-10 13:25 images\ok.png
文件 23710 2018-10-10 13:25 images\penguin.png
文件 10288 2018-10-10 13:25 images\qqCode.png
文件 101983 2018-10-10 13:25 images\reB.png
文件 3130 2018-10-10 13:25 images\return.png
文件 5946 2018-10-10 13:25 images\white.png
文件 561 2018-10-10 13:25 images\xqq.png
文件 50690 2018-10-11 10:33 QQ.jar
目录 0 2018-11-17 12:14 QQ_Demo\
............此处省略94个文件信息
- 上一篇:响应式网站前端源码
- 下一篇:环保类 Html模板
相关资源
- bootstrap3.0带源代码
- uploadifive1.2.2 uploadify HTML5
- 管理系统HTML模板
- 非常漂亮的导航菜单(html)
- DIV CSS漂亮的样式
- 布局与美化网页的CSS教程
- 网页文件HTML
- css div 实现图片展示
-
html中获取xm
l数据 - 23种CSS导航条样式
- 收缩式导航菜单(CSS DIV)
- HTML AJAX(手写ajax)显示数据库数据
- HTML5 CSS3 :canvas 模拟实现电子彩票刮
- 仿Win10 UI界面(前端html模板)
- 永劫无间主题 html+css
- 登录html
- 游戏商城html模板(首页)
- 生日祝福html代码(带背景音乐)
- 基础html小米商城
- W3C html5 参考手册(教学资源免费)
- html5 2048小游戏
- oa html模板(基于Vue开发)
- 个人网站备案的HTML模板
- html旅游静态网站
- 简易京东网页HTML代码(HTMLamp;JS;)
- 有问必答项目 html源码
- html 塔防游戏runner
- html 二十一点
- 生日祝福html网页源码(特效很多)
- 时时彩网站 html模板(手机端 )
评论
共有 条评论