This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I have just started getting into Java development, downloaded NetBeans, and am having a heck of a time with the layout of components on the frame. I can't seem to get anything to look like I want it to. I've been reading up on the various layout managers, and I'm thinking that gridbag is what I want to learn for more flexibility, but it's a pain to constantly think about the various divisions of the panel when placing a peice. Then when I want to add another component to the panel, I mess everything else up.
I've read that absolute positioning is no good because it's not scalable if the user should make the window bigger and such, how much truth is there to this? Would a different IDE be easier to use for the panels (I've downloaded JBuilder, but haven't had the chance to install or use it yet).
I'm coming from a VB background as far as client side development, I was hoping to have something as simple as the VS IDE for laying out the panels, just drag and plop it on there. Is there a way to achieve this level of ease with Netbeans?
I guess I'm shooting for popular consesus, how do you layout your panels, what's easiest for you?
Well, they're both GUI developers and full IDE's, allowing for all the nifty features that help support rapid development, including code completion, easier reading of code, and integrated debugging and such, so there's more to it. But yeah, I'm just looking at building the panels right now, and after reading through some threads on these forums, I'm getting the hankering to code em manually.
I'll take a look at the link, thanks for posting it.
I was hoping to have something as simple as the VS IDE for laying out the panels, just drag and plop it on there. Is there a way to achieve this level of ease with Netbeans?
Yep the NullLayout. Netbeans gives you this option.
Yep, this is why the NullLayout is not recommended. There is a fairly steep learning curve with the layout managers. If you are developing Swing guis proffessionally you will have to learn it. I normally try and stick to Flow, Border and Box layout and nest panels to achieve the layout I want. You can achieve most things this way and it is much simpler than GridBag, I only bring that out when I have to. Post your position woes here, folks are friendly, and someone will help !
GUI Builders can be useful for prototyping and messing around. However they do not produce production quality code, so they should not be used for this.
If you are developing Swing guis proffessionally you will have to learn it. I normally try and stick to Flow, Border and Box layout and nest panels to achieve the layout I want. You can achieve most things this way and it is much simpler than GridBag
You could use JFrameBuilder which is easy to do that. That will be much simpler than using GridBag.