当前位置: 首页 > news >正文

网站怎么推广效果好一点呢新式装修

网站怎么推广效果好一点呢,新式装修,东莞整合网站建设推广,综合类网站怎么做在Java中, 如何生成不同类型的通知或警报非常令人困惑。一些开发人员更喜欢使用JOptionPane, 但是当你在固定环境中工作时(例如在Windows 10中), 使用Windows的默认通知样式非常好, 因此这就是为什么我们向你展示一个简短的摘要来显示Java AWT轻松实现Windows 10通知。以下代码…在Java中, 如何生成不同类型的通知或警报非常令人困惑。一些开发人员更喜欢使用JOptionPane, 但是当你在固定环境中工作时(例如在Windows 10中), 使用Windows的默认通知样式非常好, 因此这就是为什么我们向你展示一个简短的摘要来显示Java AWT轻松实现Windows 10通知。以下代码在系统托盘中生成所需的通知, 因此你可以简单地为其创建一个方法, 将其包装在代码中, 或者仅更改警报的文本即可import java.awt.*;import java.awt.event.*;import java.awt.TrayIcon.MessageType;import java.net.MalformedURLException;try{//Obtain only one instance of the SystemTray objectSystemTray tray SystemTray.getSystemTray();// If you want to create an icon in the system tray to previewImage image Toolkit.getDefaultToolkit().createImage(some-icon.png);//Alternative (if the icon is on the classpath)://Image image Toolkit.getDefaultToolkit().createImage(getClass().getResource(icon.png));TrayIcon trayIcon new TrayIcon(image, Java AWT Tray Demo);//Let the system resize the image if neededtrayIcon.setImageAutoSize(true);//Set tooltip text for the tray icontrayIcon.setToolTip(System tray icon demo);tray.add(trayIcon);// Display info notification:trayIcon.displayMessage(Hello, World, Java Notification Demo, MessageType.INFO);// Error:// trayIcon.displayMessage(Hello, World, Java Notification Demo, MessageType.ERROR);// Warning:// trayIcon.displayMessage(Hello, World, Java Notification Demo, MessageType.WARNING);}catch(Exception ex){System.err.print(ex);}请注意, 代码的执行需要通过Try-Catch语句完成, 该语句可以捕获代码抛出的2个异常(AWTException, MalformedURLException)或常规异常(如上所示)。结构化的例子下面的示例显示了一个非常简单的应用程序类, 该类在Frame中绘制了一个简单的按钮。单击该按钮时, 将出现一个托盘通知package sandbox;import java.awt.*;import java.awt.event.*;import java.awt.TrayIcon.MessageType;import java.net.MalformedURLException;public class Sandbox {/*** Parsing a JSONObject string** param args*/public static void main(String[] args) {Sandbox app new Sandbox();}public Sandbox(){Frame f new Frame(Button Example);Button btn new Button(Click Here);btn.setBounds(50, 100, 80, 30);f.add(btn);f.setSize(400, 400);f.setLayout(null);f.setVisible(true);Sandbox _this this;btn.addActionListener(new ActionListener(){Overridepublic void actionPerformed(ActionEvent e){if (SystemTray.isSupported()) {try{_this.displayTray();}catch(AWTException ex){}catch(MalformedURLException ex){}} else {System.err.println(System tray not supported!);}}});}public void displayTray() throws AWTException, MalformedURLException {//Obtain only one instance of the SystemTray objectSystemTray tray SystemTray.getSystemTray();//If the icon is a fileImage image Toolkit.getDefaultToolkit().createImage(icon.png);//Alternative (if the icon is on the classpath)://Image image Toolkit.getDefaultToolkit().createImage(getClass().getResource(icon.png));TrayIcon trayIcon new TrayIcon(image, Java AWT Tray Demo);//Let the system resize the image if neededtrayIcon.setImageAutoSize(true);//Set tooltip text for the tray icontrayIcon.setToolTip(System tray icon demo);tray.add(trayIcon);trayIcon.displayMessage(Hello, World, Java Notification Demo, MessageType.INFO);}}前面的代码将生成以下框架并显示通知编码愉快
http://wiki.neutronadmin.com/news/170195/

相关文章:

  • 寿光建设网站网站建设中首页模板
  • 六安商务网站建设电话华为荣耀官网入口
  • 乐亭网站建设提供服务好的网站归档系统
  • 江苏泰州建设局网站旧域名新网站
  • 昆明网站建设天猫运营京东购物平台
  • 深圳游戏网站开发虚拟主机网站源码
  • 什么网站做优化最好?温州网站建设方案推广
  • win2003 做网站服务器上海域名网站吗
  • 有没有做淘宝网站的网站代理怎么做的
  • 企业网站建设服务哪家好上海网站推广策划
  • 广州城中村进行优化
  • 如何建立自己推广网站设计素材网站p开头的
  • 北京做手机网站的公司隆回网站建设制作
  • 全国思政网站的建设情况培训网站建设机构
  • 网站后台页面设计教程网络营销的内容是什么
  • 网站开源程序网站做美工
  • 网站建设用什么程序图表 wordpress
  • 本地电脑静态网站建设做二手货的网站
  • 营销网站用户体验有哪些网页游戏排行选择
  • 国内做网站建设知名的公司软件开发者模式
  • 怎么做网站排名优化免费视觉设计评价标准的要素
  • 登录浏览器是建设银行移动门户网站做短租类型的网站
  • 美丽南方官网网站建设凡科商城是什么
  • 湖北网站推广公司技巧做网站跳转怎么收费
  • 深圳网站建设clh重庆开县网站建设公司推荐
  • 网站设置不可粘贴免费网站优化排名
  • 温州电力建设有限公司网站深圳电商代运营公司排名
  • 个人网站建设价格表wordpress访客函数
  • jsp开发网站开发源码有没有什么设计排版类网站
  • 如何转移网站宝安营销型网站制作