Associated article: Java Q&A
Published source code accompanying the article by Evan Easton in which he presents in Java a C/C++ like enum that lets you define a constrained set of options for an API parameter. Also see JQA1099.ZIP
Java Q&A by Evan Easton Listing One // Pass in an invalid alignment new Label("Read me!", 4); Listing Two java.lang.IllegalArgumentException: improper alignment: 4 at java.awt.Label.setAlignment(Label.java:184) at java.awt.Label.<init&...