Java
文章平均质量分 84
Alend_Yin
Hi, I’m Alend!
I’m a thoughtful boy. I love thinking, thinking about the essence of everything in the world, as well as human nature.
I’m also a realistic and optimistic guy. I love the romantic and easeful life style with a little challenge, which is
展开
-
Java Swing 皮肤外观——The Alloy Look and Feel
//在窗体程序运行前,先加载皮肤,示例程序如下://先导入这两个包import javax.swing.*;import com.incors.plaf.alloy.AlloyLookAndFeel;public class Program { public static void main(String[] args) { //加载皮肤 try原创 2008-03-03 20:38:00 · 2161 阅读 · 0 评论 -
java中实现多线程
java中实现多线程有两种方法:继承Thread类和实现Runable接口。(实际上Thread类实现了Runable接口)当用户线程类仅仅继承Thread类,则选用第一种方法,然而当要继承多个类,则实现Runable接口。两种方法的实现如下:一、继承Thread类//定义自己的线程类class Mythread extends Thread{ //重写Thread类中的Run函原创 2008-03-03 21:04:00 · 367 阅读 · 0 评论 -
在JSP+Servlet中使用会话跟踪技术的代码框架
Web应用创建于HTTP之上,这会有一个严重的问题,即HTTP是一个无状态的协议,每个请求和相应都是独立的。如果没有会话管理,每次客服端向服务器端发起一个请求,服务器端都不会记录有关客户的任何信息。从服务器度端的角度看,一个新的请求就是一个新的用户,这个请求和其它请求也没有任何关系。为了解决这个问题,在web中引入了会话(session)的概念。一个会话(session)是指从客户端发起第一个原创 2008-03-03 20:59:00 · 868 阅读 · 0 评论 -
java处理cookies
cookies是一种WEB服务器通过浏览器在访问者的硬盘上存储信息的手段:如IE浏览器把Cookie信息保存在C:/Document and settings/your name/cookies的目录下。当用户再次访问某个站点时,服务端将要求浏览器查找并返回先前发送的Cookie信息,来识别这个用户。cookies有下列优点: 1、Cookie能使站点跟踪特定访问者的访问次数、最后访问时间原创 2008-03-03 21:02:00 · 861 阅读 · 0 评论 -
JDBC中的事务支持
数据库中事务(transaction)的主要目的是让数据库从一个稳定的状态变化到另一个稳定的状态。当数据库中进行提交时,应该保证所有的变化都已经保存了;如果进行回滚,那么所有的变化都不保存。在jdbc中,事务的启动是有jdbc驱动自动完成的,而事务的终止则可以是自动也可以是手动。事务自动终止还是手动终止是由连接的自动提交状态来判断的,对于jdbc,默认的自动提交状态是true,也就是说事务由驱原创 2008-03-02 19:55:00 · 804 阅读 · 0 评论 -
Ant使用入门
*前言Apache Ant是一个基于Java的构建工具。从理论上讲,也是一种类似于Make的工具,只是去除了Make工具的缺点。简单的说,Ant是一个基于Java,并且主要用于Java工程的构建工具。Ant本意是Another Neat Tool,也就是另一种整洁的工具,取首字符就是Ant。*下载并安装ant1.下载Ant(http://www.apache.org),现在的最新版本是1.7.0原创 2008-03-03 21:14:00 · 1065 阅读 · 2 评论 -
制作可执行jar文件
在Windows下,用C++或C#写的桌面软件编译之后都是以可执行文件(.exe)的形式出现,只需双击便可运行。然而用java写的桌面应用软件编译之后是以学多字节码文件(.class)的形式出现,本文介绍了怎样制作像exe一样的可执行jar文件。 1 将该软件包含的.class文件打包成jar文件。 如一个软件的结构如下 - soft原创 2008-03-03 20:54:00 · 1849 阅读 · 0 评论 -
java.util.Properties的使用
一般的,对于一个稍有规模的软件,总会有它的配置数据(或者也称初始化数据),每当该软件启动时就从外部文件资源中读取相应的初始化数据。在Windows系统中用C++或C#来开发软件时,可以调用相应的API来操作注册表或INI文件来实现此功能。在java中,java.util.Properties类便扮演了此功能的角色,它继承自java.util.Hashtable类,下面先列举该类几个有用的成员函数。原创 2008-03-03 20:51:00 · 488 阅读 · 0 评论 -
java annotation入门,使用手册,高级应用合集
为方便学习,我收集了网上cleverpig的三篇文章——java annotation入门,使用手册和高级应用。本文作者为cleverpig(作者的Blog:http://blog.matrix.org.cn/page/cleverpig),我只是收集,^_^Java Annotation入门摘要:本文针对java初学者或者annotation初次使用者全面地 说明了annotation的使用方法转载 2008-03-03 21:12:00 · 1331 阅读 · 1 评论 -
JUnit介绍及其快速使用
JUnit 是 Java 社区中知名度最高的单元测试工具。它诞生于 1997 年,由 Erich Gamma 和 Kent Beck 共同开发完成。其中 Erich Gamma 是经典著作《设计模式:可复用面向对象软件的基础》一书的作者之一,并在 Eclipse 中有很大的贡献;Kent Beck 则是一位极限编程(XP)方面的专家和先驱。麻雀虽小,五脏俱全。JUnit 设计的非常小巧,但是功原创 2008-03-03 21:08:00 · 882 阅读 · 1 评论 -
抽象类和接口的区别
abstract class 和interface是Java语言中对于抽象类定义进行支持的两种机制,正是由于这两种机制的存在,才赋予了Java强大的面向对象能力。 abstract class和interface之间在对于抽象类定义的支持方面具有很大的相似性,甚至可以相互替换,因此很多开发者在进行抽象类定义时对于abstract class和interface的选择显得比较随意。其实,两者之间还是原创 2008-03-03 21:06:00 · 215 阅读 · 0 评论