惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
GbyAI
GbyAI
P
Proofpoint News Feed
B
Blog
MyScale Blog
MyScale Blog
V
V2EX
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
量子位
Jina AI
Jina AI
博客园 - 叶小钗
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
罗磊的独立博客
L
LangChain Blog
I
InfoQ
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
小众软件
小众软件
V
Visual Studio Blog
月光博客
月光博客
The Cloudflare Blog
雷峰网
雷峰网

博客园 - Tommy's Blog

正则表达式学习 常用的正则表达式字段 BBS List C# Learning Notes SharePoint Portal Server error message Microsoft TechNet中文网络广播 Learning C# Watched .NET componets [Idea] - online english recite Sample web page designers in China My goal 2005 Some google words PDF library Windows Scripting Google SEO digest Wallop invitation Favorite .NET open source projects My registered blogs 定制Internet Explorer扩展界面接口
JDK 1.5 notable new features..
Tommy's Blog · 2004-12-20 · via 博客园 - Tommy's Blog

Some new features in JDK which maybe quite useful...

1. Generic Types

ArrayList<Integer> list =  new ArrayList<Integer>();
   list.add(0, new Integer(42));
   int total = list.get(0).intValue();

2. Formatted output
 System.out.printf("%s %5d%n", user,total);

3. New loops

ArrayList<Integer> list = new ArrayList<Integer>();
  for (Iterator i = list.iterator(); i.hasNext();) {
         Integer value=(Integer)i.next();
    }

4. variable number of arguments

void argtest(Object ... args) {
      for (int i=0;i <args.length; i++) {
      }
    }
   
    argtest("test", "data");

5. AWT/Swing

AWT

Version 5.0 features many AWT enhancements and bug fixes, including some that have often been requested by our customers. Most notably, the new MouseInfo class makes it possible to determine the mouse location on the desktop. New Window methods make it possible to specify the default location for a newly created window (or frame), appropriate to the platform. Another Window enhancement makes it possible to ensure that a window (or frame) is always on top. (This feature does not work for some window managers on Solaris/Linux.) In the area of data transfer, the new DropTargetDragEvent API allows the drop target to access transfer data during the drag operation.

Swing

With the 1.4.2 release we provided two new look and feels for Swing: XP and GTK. Rather than taking a break, in 5.0 we're providing two more look and feels: Synth, a skinnable look and feel, and Ocean, a new theme for Metal. Beyond look and feels, we've added printing support to JTable, which makes it trivial to get a beautiful printed copy of a JTable. Lastly, after seven years, we've made jFrame.add equivalent to jFrame.getContentPane().add().