-
大小: 148KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-05-22
- 语言: 其他
- 标签: httpclient
资源简介
帮朋友的忙写了个小应用,他需要每隔一段时间自动访问一个网页,如果发现特定的内容就弹框提醒和声音提醒,一条消息已经提醒过了就不用再次提醒了,只有遇到新的才提醒。
代码片段和文件信息
package com.tgb.lk.demo.httpclient;
/**
* Created by likun on 2015/9/28.
*/
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
public class DialogMessage extends javax.swing.Jframe {
private JLabel text;
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension screenSize = tk.getScreenSize();
int height = screenSize.height;
int width = screenSize.width;
private String str = null;
public DialogMessage(String str) {
this.str = str;
new Thread(new Runnable() {
@Override
public void run() {
initGUI();
}
}).start();
}
private void initGUI() {
try {
setUndecorated(true);
setLocationRelativeTo(null);
setVisible(true);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
{
text = new JLabel(““ + str + ““ JLabel.CENTER);
getContentPane().add(text BorderLayout.CENTER);
text.setBackground(new java.awt.Color(255 251 240));
}
pack();
setBounds(width - 380 height - 150 360 100);
try {
Thread.sleep(9000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
dispose();
} catch (Exception e) {
e.printStackTrace();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-09-30 22:20 lk-httpclient\
文件 12850 2015-09-30 22:19 lk-httpclient\lk-httpclient.iml
文件 1169 2015-09-30 22:20 lk-httpclient\pom.xm
目录 0 2015-09-23 12:03 lk-httpclient\src\
目录 0 2015-09-23 12:03 lk-httpclient\src\main\
目录 0 2015-09-23 13:33 lk-httpclient\src\main\java\
目录 0 2015-09-23 13:33 lk-httpclient\src\main\java\com\
目录 0 2015-09-23 13:33 lk-httpclient\src\main\java\com\tgb\
目录 0 2015-09-23 13:33 lk-httpclient\src\main\java\com\tgb\lk\
目录 0 2015-09-23 13:33 lk-httpclient\src\main\java\com\tgb\lk\demo\
目录 0 2015-09-30 22:04 lk-httpclient\src\main\java\com\tgb\lk\demo\httpclient\
文件 1579 2015-09-30 22:04 lk-httpclient\src\main\java\com\tgb\lk\demo\httpclient\DialogMessage.java
文件 3900 2015-09-30 22:04 lk-httpclient\src\main\java\com\tgb\lk\demo\httpclient\HttpClientTest.java
文件 820 2015-09-28 13:09 lk-httpclient\src\main\java\com\tgb\lk\demo\httpclient\SoundMessage.java
目录 0 2015-09-28 13:00 lk-httpclient\src\main\resources\
目录 0 2015-09-28 13:08 lk-httpclient\src\main\resources\sounds\
文件 90044 2015-09-28 13:07 lk-httpclient\src\main\resources\sounds\alert.wav
目录 0 2015-09-23 12:03 lk-httpclient\src\test\
目录 0 2015-09-30 22:21 lk-httpclient\src\test\java\
目录 0 2015-09-30 22:20 lk-httpclient\target\
目录 0 2015-09-30 22:20 lk-httpclient\target\classes\
目录 0 2015-09-30 22:20 lk-httpclient\target\classes\com\
目录 0 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\
目录 0 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\
目录 0 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\
目录 0 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\httpclient\
文件 707 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\httpclient\DialogMessage$1.class
文件 2378 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\httpclient\DialogMessage.class
文件 2626 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\httpclient\HttpClientTest$1.class
文件 3932 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\httpclient\HttpClientTest.class
文件 1549 2015-09-30 22:20 lk-httpclient\target\classes\com\tgb\lk\demo\httpclient\SoundMessage$1.class
............此处省略9个文件信息
- 上一篇:封装一个类搞定90%安卓客户端与服务器端交互
- 下一篇:SP3490中文资料
评论
共有 条评论