Not long ago I was at an Adobe conference and was talking to the speaker about VBox and HBox use. I’d read an article about trying not to nest too many HBox or VBox elements as it could inhibit redraw performance. The speaker couldn’t understand why I’d use vertical and horizontal positioning (VBox & HBox) elements instead of Canvas. I knew there was a reason but I couldn’t remember it.
It just struck me today. I have a global text increaser and decreaser in my application. A Canvas is great for layout, except when it’s children start to outgrow it. When that happens, you’ll get clipping and scrollbars and bang… there goes your accessible web app.
So if your Canvas’s children will remain smaller than the height of your canvas, then use it. Otherwise, start reaching for those Boxes.
Nevertheless, do try to limit your nested vertical/horizontal layout items as much as possible.