Over a million developers have joined DZone.

Predefined Property Editors for Swing Applications

· Java Zone

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

One of the hidden gems of the NetBeans RCP is its set of predefined Property Editors. For example, if you have a business object that uses java.awt.Color as one of its properties, the Properties window (and other related components, such as the OutlineView), will show a predefined editor so that the user can edit the colors, without you having to define the editor for doing so:

 

But that's not all, as the related documentation reveals. There are similar dedicated property editors for all the following properties:

  • java.lang.Boolean
  • java.awt.Color
  • java.awt.Dimension
  • java.awt.Font
  • java.awt.Insets
  • java.lang.Integer
  • java.awt.Point
  • java.awt.Rectangle
  • java.io.File
  • java.lang.Class
  • java.lang.String
  • java.net.URL
  • java.util.Date
  • java.util.Properties
  • javax.swing.ListModel
  • javax.swing.table.TableModel

However, note the warning in the link above about these property editors: "Beware that some of these editors may not provide the ability to edit the full range of values of the corresponding data type, as they may be specialized for the NetBeans environment."

 

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}