Providing Custom Text-Based Property Editors

Your PictureButton bean is looking slick. However, how will your users know what images are available for them to display on the face of the button? The imageFilename property editor is a blank text box. It requires that users know the full filename of the image file that they want to load from PictureButton bean's JAR file. Your users shouldn't need to work so hard, and you shouldn't need to provide outside documentation so that they can know such things. Instead, add a custom property editor to the PictureButton bean that lists the available files. Now all users need to do is select the file they want.

You need to do two things to provide the PictureButton bean with a custom property editor. You ...

Get JavaBeans Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.