GroupLayout:值得学习吗? [英] GroupLayout: Is it worth learning?

查看:138
本文介绍了GroupLayout:值得学习吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我比较新的java(特别是swing),最近一直在制作一些相当简单的应用程序,当我走的时候学习。最新的一个具有许多表单组件,如JLabels,JTextFields,JButtons等等。所有这些都使用视觉构建器放置在NetBeans中。我不得不说,我不是真的采取了NetBeans,并且真的只是设计GUI并将代码直接复制到Eclipse。



我的问题是:是否值得对GroupLayout和手工编码有很好的了解(因此对我的GUI有更多的控制权),还是继续按原样进行?

解决方案

如果只是因为总是一个好主意来了解你的IDE是在做什么,那么值得花一些时间来理解 GroupLayout 。了解幕后的事实实际上使您更灵活,因为如果您在无法访问Netbeans的情况下结束,您将会知道如何复制其为您生成的布局。此外,在您获得体面的体验之后,您可能会整体节省时间。您可以通过手动更快地开发简单的GUI,而不是使用可视化编辑器,特别是考虑将代码从Netbeans复制并粘贴到Eclipse的时间。



当然,学习如何使用 GroupLayout 手工还可以使您更轻松地转换到任何其他布局管理器Java提供,这反过来可以导致更简单代码,节省更多时间。


I'm relatively new to java (specifically swing) and have recently been making some fairly simple applications, learning as I go. The latest one has lots of form components such as JLabels, JTextFields, JButtons, etc etc. All were placed in NetBeans using a visual builder. I have to say I'm not really taking to NetBeans and have really just been designing the GUI and copying the code straight to Eclipse.

My question is: Is it worth getting a very good understanding of GroupLayout and coding by hand (and therefore having more control over my GUI) or just continuing on as is?

解决方案

I'd say it's worth taking some time to understand GroupLayout if only because it's always a good idea to understand what your IDE is doing. Knowing what goes on behind the scenes actually makes you more flexible, because if you wind up in a situation where you don't have access to Netbeans, you'll know how to replicate the layout it would have produced for you. Besides, after you've gotten a decent amount of experience, you'll probably wind up saving time overall. You can often develop a simple GUI faster by hand than by using a visual editor, especially considering the time it takes you to copy and paste the code from Netbeans to Eclipse.

And of course, learning how to use GroupLayout by hand will also make it easier for you to transition to any of the other layout managers Java offers, which in turn can lead to simpler code and even more time saved.

这篇关于GroupLayout:值得学习吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆