易截截图软件、单文件、免安装、纯绿色、仅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());
// 创建时间精灵


相关文档:

获取文件最后修改时间(java)

import java.text.Format;
import java.text.SimpleDateFormat;
File file = new File("a.txt");
long time = file.lastModified();
Date d = new Date(time);
Format simpleFormat = new SimpleDateFormat("E dd MMM yyyy hh:mm:ss a");
String dateString = simpleFormat.format(d);
System.err.println(file.getN ......

JAVA变量path , classpth ,JAVA_HOME设设置作用和作用

http://www.goceanedu.com.cn/Read_1855.htm

在把jdk安装到计算机中之后,我们来进行设置使java环境能够使用。
首先右键点我的电脑。打开属性。然后选择“高级”里面的“环境变量”,在新的打开界面中的系统变量需要设置三个属性“JAVA_HOME”、
“path”、“classpat ......

java中String和int之间的相互转化

java中
String和int之间的相互转化
(1)int i = Integer([String]); 或
     int i = Integer.parseInt([String],[int index]);
(2)int i = Integer.valueOf([String]).intValue();
int类型转化为String
(1)String s = String.valueOf([int]);
(2)String s = Integer.toString([int]);
......

Java架构师所需要的知识


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Mat ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号