I'm having trouble figuring out how to place some components using GridBagLayout inside a panel. By using GridBagConstraints and its gridwidth and gridheight properties I was able to get the number of columns I wanted (just one), now I'd like to ask you guys if you know a way to place my components near the top-left corner.
Here are the important bits of my code, I've removed the NetBeans-generated code
I'm attaching two files for your better understanding. The first one(Before.jpg) shows what I've got so far, and After.jpg shows what I want to accomplish. Really easy (I guess), and I need the GridBagConstraints to make it. All Components should be placed in Left-Justified manner, like sticking to the imaginary red vertical line I drew on it.
Ok, That'd be it, I hope you can show me how to do it.
That is what I was looking for. I started tweaking a lot of other ways before you posted your response and I ended up abandoning GridBag. I used no layout whatsoever... however, I tested your code, and I'll keep it as my backup just in case.
Thanks for the free lesson, I kind of like Swing.
Good Luck,
Jose.
What a stench! Central nervous system shutting down. Save yourself tiny ad!