Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Predefined Property Editors for Swing Applications

DZone's Guide to

Predefined Property Editors for Swing Applications

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

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

 

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

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

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}