- 1、本文档共15页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
渐隐渐显(国外英文资料)
渐隐渐显(国外英文资料)
代码如下.
import java.awt.toolkit.
import java.awt.event.windowadapter.
import java.awt.event.windowevent.
import javax.swing.jeditorpane.
import javax.swing.jframe.
import javax.swing.jlabel.
import com.sun.awt.awtutilities.
/ * *
* 屏幕右下角出现渐隐渐显的提示框
* 使用到了jdk1.6中新特性的透明窗体, 所以必须要使用jdk1.6或以上版本的jdk
* 案例性质: 原创案例
* 案例来源: http: / /
* 作者: 宋海康
*
* 功能如下.
* 1.窗体出现时逐渐清晰
* 2.停留一会儿时间之后会自动逐渐模糊直至消失
* 3.点击关闭按钮后逐渐模糊直至消失
* 4.提示内容支持html标签
* * * * * * @ author shk
*
* /
public class translucentframe implements runnable {
jframe frame.
jlabel label1.
jeditorpane editorpane1.
private int width; / / 窗体宽度
private int height); / / 窗体高度
private int staytime; / / 休眠时间
private string title, message); / / 消息标题, 内容
private int style; / / 窗体样式
/ * *
* 渐隐渐显的提示框
*
* @ param width 提示框宽度
* @ param height 提示框高度
* @ param staytime 提示框停留时间
* @ param 提示框的样式 style
* 以下为样式可选值.
* 0 无装饰 (即去掉标题栏)
普通窗口风格 * 1 frame.
_ dialog 简单对话框风格 level * 2
* 3. 信息对话框风格 _ dialog
* 4) 错误对话框风格 _ dialog
5 color _ chooser 拾色器对话框风格 _ dialog
* * file _ chooser 文件选择对话框风格 _ dialog
* 7 问题对话框风格 _ dialog
_ 警告对话框风格 8 warning dialog
* @ param title 提示框标题
* @ param message 提示框内容 (支持html标签)
* /
the public translucentframe (int width, int height, and staytime, int style, string title, string message) {
this.width = width.
this.height = height;
this.staytime = staytime.
this.style = style;
this.title = title.
this.message = message.
}
/ * *
* 渐隐渐显的提示框
*
* @ param 提示框样式同上 style
* @ param title 提示框标题
* @ param message 提示框内容
* /
the public translucentframe (string title, int style (string message)
this.width = 250.
this.height = 180.
this.staytime = 5.
this.style = style;
this.title = title.
this.message = message.
}
public static void main (string [] args) {
title = string 友情提示. ;
string text = strong / strong jdk1.6新特性测试 《透明窗体》 br br http: / / br 作者: 宋海康;
/ / / / / / / / runnable translucent = new translucentframe (250180,10,4 title, message);
runnable translucent = new translucentframe (2) title, message);
线程=新线程(半透明);
st
您可能关注的文档
最近下载
- EN 50530-2010+A1-2013 并网光伏逆变器的整体效率.pdf
- 2019年度中国法学会部级法学研究课题申请书.docx
- 青蓝工程记录册培训资料.doc
- 北京工业大学2019-2020学年第2学期《高等数学(下)》期末考试试卷(B卷)及标准答案.docx
- 2023年甘肃省兰州市中考生物试题卷(含答案解析).docx
- 《波特钻石模型》课件.pptx VIP
- 童年创伤问卷(CTQ-含评分说明).doc
- 2023年普通高等学校在津招生计划.pdf VIP
- 2023年全国各大高校在天津招生计划及分数 .pdf VIP
- 高中数学竞赛(强基计划)历年真题练习15导数与极限(学生版+解析版).pdf VIP
文档评论(0)