易截截图软件、单文件、免安装、纯绿色、仅160KB

Java版世界时钟示例

这是一个Java版的世界时钟示例,移植自Gerrit创建的同名Swing应用(http://www.jug-muenster.de/swing-worldclock-427
),需要运行在JRE1.5或以上环境当中。
移植此示例主要是因为前一阵移植过Gerrit的swing原子钟示例,所谓好事成双,这个世界时钟的示例自然不能放过(话说Gerrit为什么那么喜欢做时钟?……),毕竟Java桌面应用实例本就不多,但凡有参考价值的还是要多做汇总才好。
另外,此示例中关于多时区的分辨与显示部分,在非桌面应用中也具备一定的参考价值。
PS:由于此示例以LGame-Simple-0.2.5开发,所以也可以看作是世界时钟的AWT实现。
下载地址(源码在jar中):http://loon-simple.googlecode.com/files/WorldClock.7z
运行代码如下所示(构建过程省略了Swing原版的一些步骤):
package org.loon.test;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import org.loon.framework.game.simple.GameScene;
import org.loon.framework.game.simple.core.graphics.Deploy;
import org.loon.framework.game.simple.core.graphics.Screen;
import org.loon.framework.game.simple.utils.GraphicsUtils;
/**
* Copyright 2008 - 2009
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
* @project loonframework
* @author chenpeng
* @email:ceponline@yahoo.com.cn
* @version 0.1
*/
public class Main extends Screen {
// 此示例移植自http://www.jug-muenster.de/swing-worldclock-427/同名应用
public Main() {
// 设置窗体背景
this.setBackground(createBackgroundImage());
// 创建时间精灵


相关文档:

PermGen space Java heap space 内存溢出


1、
PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决方法也一定是加大内存。说说为什么会内存益出:这一部分用于存放Class和Meta的信息,Class在被 Load的时候被放入PermGen space区域,它和和存放Instance的Heap区域不同,GC(Garba ......

Java 中 Vector、ArrayList、List 使用深入剖析


线性表,链表,哈希表是常用的数据结构,在进行Java开发时,JDK已经为我们提供了一系列相应的类来实现基本的数据结构。这些类均在java.util包中。本文试图通过简单的描述,向读者阐述各个类的作用以及如何正确使用这些类。 
Collection
├List
│├LinkedList
│├ArrayList
│└Vector
│ └Stack
└Set
M ......

Java中的转义字符

\n 换行(\u000a)  
\t 水平制表符(\u0009)  
\b 空格(\u0008)  
\r 回车(\u000d)  
\f 换页(\u000c)  
\' 单引号(\u0027)  
\" 双引号(\u0022)  
\\ 反斜杠(\u005c)  
\ddd 三位八 ......

JAVA规范大集合(备忘)


 
Java 标准与规范
 
本栏目提供了大量的 Java 技术标准与规范的简介、官方网址以及 developerWorks 网站上相关的技术资源。通过本栏目,您不但可以了解当前 Java 社区主要的技术标准和规范,还可以通过查看相关的技术文章和教程进行更深入的学习,从而更好地为实际的 Java 项目进行技术选型。
A B C D E F ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号