Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
Custom Layout Manager
posted

I'm wondering what would go into creating my own layout manager. Neither the flow layout manager nor the gridbag layout manager seems to do exactly what I want, although the flow layout manager might be able to work with some customization.

Basically, I want to be able to add controls with a default gap between, but the gap should be overridable, perhaps with something akin to the inset for the gridbag. I also want to be able to control where a new row would occur, also conceptually doable with a constraint, I would guess. The gap between rows should also have a default size that is overridable.

I am unsure how to start on this and would welcome any help. Could this be done with subclassing the flow layout and creating constraint objects to handle the customized gaps and forced wrap, or would it be better to start from the base class? Are there any tutorials/samples that would help?

Thank you,

Jon Scharff

Parents Reply Children