Recent top five:
Let's talk about exceptions ...
How do you handle exceptions? Do you think upfront about the type of exceptions that you want to catch or do you just let
the outside world handle it?
-- Jeroen van Bergen in JW Blogs
| Enterprise AJAX - Transcend the Hype |
| Memory Analysis in Eclipse |
| Oracle Compatibility Developer's Guide |
| Memory Analysis in Eclipse |
What you may not know is that JavaBeans properties are not limited to scalar (that is, single-valued) values. A JavaBeans property can also be an array of values, accessed by an integer index, called an indexed property.
This month, we're going to tackle creating a shiny new JavaBean with an indexed property, and a custom property editor that
allows the developer to manipulate the indexed property at design time. We'll start by creating a basic URLFileLoader bean that downloads a file from an arbitrary URL on the Web, and stores it in a disk file on demand (taking a quick side
excursion into boolean properties, a simple property type). Then we'll improve the URLFileLoader class loader, enabling it to fetch files using HTTP GET with parameters maintained by a new indexed property. (We'll go over GET later on in the text.) Next, we'll create a custom editor (so we can access the property graphically), and see how to specify
this custom editor with the builder tool (in our case, Sun's BeanBox.) We'll wrap up with a discussion of possible extensions
to this project.
PropertyChangeListener, mentioned above, is one) are explained thoroughly in "Keep listening for upcoming events," available at http://www.javaworld.com/jw-10-1997/jw-10-beans.html
PropertyChangeListener, see "Double Shot, Half Decaf, Skinny Latte -- Customize your Java" at http://www.javaworld.com/jw-09-1997/jw-09-beans.html
HTTP POST and saves the results (based on URLDataLoader, of course,) check out JavaWorld's "Java Tip 34POSTing via Java" http://www.javaworld.com/javatips/jw-javatip34.html