-
Notifications
You must be signed in to change notification settings - Fork 66
Swing Utilities
Eugene Ryzhikov edited this page Apr 18, 2014
·
4 revisions
Embraces bean property concept. Includes automated property change notifications.
Properties
are usually private static final
fields of the bean. Only two methods have to be implemented:
-
get
- how to retrieve property value -
setValue
- how to set property value
After that bean's getter methods should simply call property get
methods and bean's setter methods should call propertiy set
(not setValue
) methods. Property change notification will be send automatically and correctly.
Example of such implementation can be found in TaskDialog
class
Makes taking screenshots very simple
Screenshot shot = Screenshot.capture( new Rectangle(100,100));
Image can be retrieved from the resulting screenshot or it can be stored as a file:
Image img = shot.getImage();
shot.store( "jpg", new File("C:/image.jpg") );
Graphic environment information can be used to make full screen shots
DisplayMode dm = Screenshot.getDisplayInfo().get(0); // get information for display 0
Screenshot shot = Screenshot.capture( dm.getWidth(),dm.getHeight());