Wrap Layout Demo

The AWT FlowLayout has a known bug that sometimes causes it to hide some components. This happens when FlowLayout is used the usual way, to layout a few Buttons in the North or South Panel, of a larger BorderLayout Panel. If everything fits on a single row, all is well. But if the FlowLayout has to wrap onto a second row, it never asks for the extra height, which causes it to hide some components. Even resizing the Container will not help, because the extra height is never requested. The bug has been around so long that some call it a feature, which of course it is not!

WrapLayout.java overrides one method, for a fully compatible extension which corrects that bug.

This WrapDemo.java applet shows it in use. This applet does not really do anything, it is the layout that is being demonstrated.
You cannot run applets

Other Java..

Please also visit my home page.

Was this Helpful?

Was this Helpful? Was it what you were looking for? How did you find this page? Search result, following a link, recommendation? Please let me know. Email me at morris_hirsch@brown.edu

Legalities

This software is provided free of charge with no support. Email me at morris_hirsch@brown.edu if you do have a problem, and I will try to help, but I cannot promise to.

Except for all sections which are identified as the work, and copyright, of others, this work is Copyright (C) 1998 by Morris Hirsch. All rights reserved, except as granted here.

Redistribution and use in source and binary forms, with or without modification, for any purpose, are permitted, except as may be restricted by original copyright holders, provided that the following conditions are met:

DISCLAIMER

This software is provided free of charge with no support.
This software is provided in source format; You are advised to examine it and understand it, before putting it to use.
This software uses only algorithms and coding techniques that are available to the public in the open literature. You are however, advised to make your own determination of legality, for your intended use.
This software is provided by the Author and Contributors ``AS IS'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose, are disclaimed.
In no event shall the Author or Contributors, or their Agents, be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
1