• 欢迎访问ByWei.Cn,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,加入百味博客 软件定制QQ群
  • 已升级为最新版主题,并将持续优化改造中,支持说说碎语功能,可像添加文章一样直接添加说说,博客主题升级啦
  • 感谢您百度求点赞啊!百度网址
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏百味博客吧
  • 博主热烈欢迎 软件定制开发 联系:http://www.bywei.cn

jdk1.7正式版新特性一览表

编程语言 百味博客 13年前 (2011-08-08) 1705次浏览 0个评论 扫描二维码

jdk1.7新特性和新功能的用法

  新增了jLayer类,修饰swing组件;
  把swing从java.sun.***.swing 移动到了javax.swing中;
  增加了窗体透明效果和不规则窗体效果;
  JColorChooser 类新增 HSV tab;
  在html中嵌入jnlp文件;
  可在javascript中检测applet是否加载完成;
  可拖拽程序到浏览器外部或者使用快捷方式启动;
  网络URLClassLoader.close方法;
  支持 Sockets Direct Protocol (SDP) 提供高性能网络连接;
  集合新增TransferQueue接口,是BlockingQueue的改进版,实现类为LinkedTransferQuene;
  xml中支持jaxp,jax-ws,jaxb;
  switch代码块中加入String的支持;
  创建List / Set / Map 时写法:
    List< String> list = ["item"]; 
    String item = list[0]; 
    Set< String > set = {"item"}; 
    Map< String,Integer > map = {"key" : 1}; 
    int value = map["key"];
  资源的自动回收管理:
        try (BufferedReader br = new BufferedReader(new FileReader(path)) { 
         return br.readLine(); 
        }
  泛型实例创建:
   Map<String,String> hello = new Map<>();
  在数字中使用下划线
    int billion = 1_000_000_000;
  二进制符号:
    int binary = 0b1001_1001;
  一个catch里捕捉多个异常类型:
        try { 
    Here comes your code…. 
    } 
    catch(IOException | NullPointerException | ……….) { 
    }
 
  jdk1.7的bug:jdk1.7hotspot循环bug,OSR(On-Stack Replacement)控制流退出且对应的内存没

有被考虑到,JVM统计导致使用循环优化后的JVM崩溃
 

 

 
作者:Nasser  新特性一览表

  Swing

  新增 JLayer 类,是一个灵活而且功能强大的Swing组件修饰器,使用方法:How to Decorate Components with JLayer.

  Nimbus Look and Feel 外观从 com.sun.java.swing 包移到 javax.swing 包中,详情:javax.swing.plaf.nimbus.

  更轻松的重量级和轻量级组件的混合。

  支持透明窗体以及非矩形窗体的图形界面,请看 How to Create Translucent and Shaped Windows。

  JColorChooser 类新增 HSV tab.

  网络

  新增 URLClassLoader.close 方法,请看 Closing a URLClassLoader.

  支持 Sockets Direct Protocol (SDP) 提供高性能网络连接,详情请看 Understanding the Sockets Direct Protocol.

  集合

  新增 TransferQueue 接口,是 BlockingQueue 的改进版,实现类为 LinkedTransferQueue.

  RIA/发布

  拖拽的小程序使用一个默认或者定制的标题进行修饰,详情:Requesting and Customizing Applet Decoration in Draggable Applets.

  JNLP 文件做了如下方面的增强,详情请看 JNLP File Syntax:

   The os attribute in the information and resources elements can now contain specific versions of Windows, such as Windows Vista or Windows 7.

  Applications can use the install attribute in the shortcut element to specify their their desire to be installed. Installed applications are not removed when the Java Web Start cache is cleared, but can be explicitly removed using the Java Control Panel.

  Java Web Start applications can be deployed without specifying the codebaseattribute; see Deploying Without Codebase

  可直接在 HTML 中嵌入 JNLP 文件:Embedding JNLP File in Applet Tag.

  可在 JavaScript 代码中检查 Applet 是否已经加载完成:Handling Initialization Status With Event Handlers.

  可在 Applet 从快捷方式启动或者拖出浏览器时对窗口样式和标题进行控制:Requesting and Customizing Applet Decoration in Developing Draggable Applets.

  XML

   包含 Java API for XML Processing (JAXP) 1.4.5, 支持 Java Architecture for XML Binding(JAXB) 2.2.3, 和 Java API for XML Web Services (JAX-WS) 2.2.4.

 


百味博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:jdk1.7正式版新特性一览表
喜欢 (3)
[微信扫一扫]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址