I'm using the Spring Layout Manager to put a form in a JPanel and I'm trying to center the lines horizontally so they will stay centered when the window is resized. Nothing I've tried has worked, I can't find anything on the web, and even my fallback of seeing how Netbeans does it fails as Netbeans doesn't seem to support the Spring Layout. I'm hoping that someone out there can point me to a reference that will tell me what I need. Thanks for any suggestions.
posted 2 years ago
Maybe it would be easier to use a BoxLayout. Then you can add "glue" before and after your panel. The extra space will be allocated to the glue and your panel will be centered.