Mar
17
2009

Enforcing the aspect ratio of a Swing widget

Sometimes, a widget only looks good at a given aspect ratio (movies, pictures, etc.).

I wrote a small Swing container for this task today, which you can find at my trac installation. There is also a small example program.

Usage boils down to using

parent.add(new AspectRatioContainer(4.0/3.0, widget)).

instead of just

parent.add(widget);

Perhaps this is of use to somebody.

posted in Swing by admin

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

You must be logged in to post a comment.

 
Powered by Wordpress and MySQL. Theme by openark.org