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

Java编码规范(The Elements of Java Style)

Genaral Principles 一般约定
1.Adhere to the style
of the original.
保持最初的样式。
2.Adhere to the Principle of Least
Astonishment.
遵守最小惊奇原则。
3.Do it right the first time.

第一次就应当做好。
4.Document any deviations.
对于任何背离都应当文档注释。
Formatting
Conventions 格式约定
5.Indent nested code.
约束嵌套代码。
6.Break up long lines.
拆分长行。
7.Include white space.

包含空格。
8.Do not use "hard" tabs.
不要使用tab键。
Naming
Conventions 命名约定
9.Use meaningful names.
使用有意义的名称。
10.Use familiar names.
使用熟悉的名称。
11.Question excessively
long names.
不要使用过长的名称。
12.Join the vowel generation.

加入元音字母。
13.Capitalize only the first letter in acronyms.

只对简称的第一个字母大写。
14.Do not use names that differ only in case.

不要使用只依赖于大小写来区分的名称。
Package Names  包命名
  15.Use
the reversed, lowercase form of your organization's Internet domain
name as the root qualifier for your package names.
  采用你组织的Internet域名
的反转、小写形式作为包名称的根限定词。
  16.Use a single, lowercase word as the root
name of each package.
  使用一个唯一的小写单词作为每个包的根名称。
  17.Use the
same name for a new version of a package, but only if that new version
is still binary compatible with the previous versin, otherwise, use a
new name.
  只有当包的新版本仍然与旧版本兼容时,对于包的新版本使用相同的名称,否则使用新名称。
  
Type Names 类型命名
  18.Capitalize the first letter of
each word that appears in a class or interface name.
  对于类和接口名称只对每个单词
的第一个字母大写。
  
  Class Names  类命名
   19.Use
nouns when naming classes.
   使用名词来命名类。
  
   20.Pluralize the
names of classes that group related attributes,


相关文档:

ubntu下java中文乱码解决

cd /usr/lib/jvm/java
-1.5.0-sun-1.5.0.15/jre/lib/fonts
sudo mkdir fallback
cd fallback
sudo cp /usr/share/fonts/truetype/arphic/uming.ttc /usr/lib/jvm/java
-1.5.0-sun-1.5.0.15/jre/lib/fonts/fallback
sudo mkfontdir
sudo mkfontscale ......

java mysql连接数据库代码

package com.lovo.cq.shopping10_1.common;
import java.sql.*;
public class DbUtil {
private PreparedStatement pstmt = null;
private Connection con = null;
public DbUtil() {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://l ......

JAVA常用方法

01、让控件得到焦点
    用.requestFocus();可以获得控件焦点。
    nextFocus()则可进入下一个焦点。
02、将String类型转为int类型
    Integer.parseInt(String);
03、将Integer类型转为String类型
    String.valueOf(Integer); ......

不错的经典文章:java提速

Java语言特别强调准确性,但可靠的行为要以性能作为代价。这一特点反映在自动收集垃圾、严格的运行期检查、完整的字节码检查以及保守的运行期同步等等方面。对一个解释型的虚拟机来说,由于目前有大量平台可供挑选,所以进一步阻碍了性能的发挥。
“先做完它,再逐步完善。幸好需要改进的地方通常不会太多。”( ......

Java绘图 如何正确绘图和出现滚动条

面是我认为正确的做法(结合自己的经验写的,如果不正确,请大家指正):
  我的绘图控件是JPanel,
  出现滚动条的前提,必须让绘图控件放在JScrollPane上,
  对于JScrollPane的Layout,没有特殊要求,下面这样即可:
  view plaincopy to clipboardprint?
  jScrollPane1.setViewportView(jPanel1);
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号