Java 7 new features

Source: Internet
Author: User

New features:

Swing

  • NewJLayerClass is a flexible and powerful swing component modifier. How to Use it: how to decorate components with jlayer.
  • Nimbus look and feel looks fromcom.sun.java.swingPackage migrationjavax.swingPackage, details:javax.swing.plaf.nimbus
  • More easily mixing heavyweight and lightweight components
  • Supports graphical interfaces of transparent and non-rectangular forms. See how to create translucent and shaped windows
  • JColorChooserClass added HSV tab.

Network

  • NewURLClassLoader.closeMethod, see closing a urlclassloader.
  • Supports sockets direct protocol (SDP) to provide high-performance network connections. For more information, see understanding the sockets direct protocol.

Set

  • NewTransferQueueInterface, yesBlockingQueueAnd the implementation class isLinkedTransferQueue

Ria/release

  • The drag-and-drop applet uses a default or custom title for modification. Details: requesting and customizing applet Decoration in draggable applets.
  • The JNLP file is enhanced as follows. For details, see JNLP File Syntax:
    • TheosAttribute ininformationAndresourcesElements can now contain specific versions of Windows, such as Windows Vista or Windows 7.
    • Applications can useinstallAttribute inshortcutElement to specify 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 specifyingcodebaseAttribute; see deploying without codebase
  • JNLP file: embedding JNLP file in applet tag can be directly embedded in HTML.
  • Check whether the applet has been loaded in JavaScript code: handling initialization status with event handlers.
  • You can control the window style and title when the applet starts from the shortcut or pulls out the browser: requesting and customizing applet Decoration in developing draggable applets.

XML

  • Contains Java API for XML Processing (JAXP) 1.4.5, supports Java architecture for XML binding (jaxb) 2.2.3, and Java API for XML Web Services (JAX-WS) 2.2.4.

Java. lang Package

  • This eliminates the potential deadlock caused by non-hierarchical class loading in a multi-threaded environment. Details: multithreaded custom class loaders in Java SE 7.

Java Virtual Machine

  • Support for non-Java languages: Java SE 7 introduces a new JVM command to simplify the implementation of dynamic programming languages
  • Garbage-first collector is a server-side garbage collector used to replace concurrent mark-sweep collector (CMS ).
  • Improves the performance of Java hotspot virtual machines

Java I/O

java.nio.filePackages and related packagesjava.nio.file.attributeFile I/O and file system access are fully supported. For more information, see file I/O (featuring nio.2 ).

  • Directory<Java home>/sample/nio/chatserver/Contains a demo program using the java. NiO. File package
  • Directory<Java home>/demo/nio/zipfs/Demo program containing nio.2 NFS File System

Security

  • The new built-in support for multiple ECC-based algorithms (ECDSA/ecdh). For details, see Sun PKCS #11 provider's supported algorithms in Java PKCS #11 Reference Guide.
  • Some weak encryption algorithms are disabled. For details, see Appendix D: disabling cryptographic algorithms in Java PKI programmer's guide and disabled cryptographic algorithms in Java Secure Socket Extension (JSSE) Reference Guide.
  • Enhanced SSL/TLS in Java Secure Socket extensions

Concurrency

  • Fork/join framework, based onForkJoinPoolClass, yesExecutorThe implementation of the interface is designed to efficiently run a large number of tasks. The work-stealing technology is used to ensure a large number of worker threads work, especially suitable for multi-processor environments. For details, see fork/join.
    • Directory<Java home>/sample/forkjoin/A demo containing the fork/join framework
  • ThreadLocalRandomClass class eliminates the competition for Using Pseudo-Random Code threads. See concurrent random numbers.
  • PhaserClass is a new synchronous barrier,CyclicBarrierSimilar.

Java 2D

  • A new xrender-based Java 2D rendering pipeline supports the current X11 desktop, improving the graphics performance. For details, see System Properties for Java 2D Technologyxrender.
  • JDK can enumerate and display installed OpenType/CFF fonts.GraphicsEnvironment.getAvailableFontFamilyNamesMethod see selecting a font.
  • TextLayoutClass supports Tibetan scripts
  • libfontconfigIs a font configuration API, see fontconfig.

Internationalization

  • Unicode 6.0.0 is supported.

    • Directory<Java home>/demo/jfc/Font2DTest/Demo programs that contain Unicode 6.0
    • Java SE 7 can accommodate new currencies in ISO 4217. For more information, seeCurrencyClass.

Java programming language features

  • Binary numeric expression
  • Use underscores to separate numbers, for example, 2017322_222
  • The switch statement supports string variables.
  • Type inference for creating a generic instance
  • Raise the warning and error messages of the compiler when variable parameters are used.
  • Try-with-resources statement
  • Capture multiple exceptions at the same time

The JDBC 4.1

  • Supportedtry-The with-resources statement is used to automatically release resources, including connections, statements, and result sets.
  • Supports rowset 1.1

The article is reproduced from:Open source Chinese communityHttp://www.oschina.net

 

This Java 7 version only contains 32-bit and 64-bit versions under Windows, Linux, and Solaris. Download link: http://down.51cto.com/zt/255

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.