Over a million developers have joined DZone.

Predefined Property Editors for Swing Applications

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

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."

 

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

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 }}