BeanPeeler automatic dialog

If you're writing an app with lots of options and would like to create an edit dialog to allow the user to change them then BeanPeeler could be for you. It allows your app to display such a dialog without going to the trouble of writing it yourself. BeanPeeler is a property sheet allowing you to customize javabeans. It's similar to the property sheets that you get in IDEs such as Netbeans' Forte that you use to customise components when you drop them onto a form. It examines a bean for any read/write properties and constructs a property sheet using dropdown boxes for properties such as booleans which have discrete values and textboxes for strings and numbers. Why is this useful? Well, if you are writing a program that has many options then it saves you having to write your own editor dialog. Simply expose the properties you want to edit in the usual javabeans way: write and methods for them. You can have more control over which ones appear in the dialog by using a BeanInfo class. In the example below I've subclassed a Label and just exposed the methods for setting the text string, colours and font. Clicking on the button invokes which pops up the dialog to allow you to edit the properties.