简体   繁体   中英

Where can I find a SpringLayout option in NetBeans GUI Builder?

The Oracle Java Swing documentation for layout managers seems to imply that SpringLayout is an option when choosing a layout manager. ("SpringLayout is a flexible layout manager designed for use by GUI builders.") It does not show up as an option in NetBeans GUI Builder v.7.0. It's also very hard to find help on this subject - my questions have gone unanswered at the netbeans.org forum.

The Spring layout, as described in Java Swing doc, makes a lot of sense to me and I'd like to give it a try. Can it be added to NetBeans IDE and utilized when designing my GUI? What, specifically, do I need to download?

EDIT: removed reference to unrelated "Spring Framework"

The simple answer is this: NetBeans does not have support for the SpingLayout.

The GUI builder has been updated though in terms of it's GridBagLayout designer. Have you tried that? It's not quite the granularity offered with SpringLayout, but with the new builder tool, making very precise layouts is a breeze!

Netbeans does not offer support for SpringLayout, at least according to this link: http://netbeans-org.1045718.n5.nabble.com/SpringLayout-and-Matisse-td2861103.html

In it developers seem to agree that GroupLayout is a more effective replacement of SpringLayout.

To bring this question up to date to 2015 (for all those who like me found themselves looking in vain for support for SpringLayout in Netbeans) it still does not exist, and probably never will.

Many other answers here on SO about difficulties with LayoutManagers suggested using MigLayout ... but Netbeans does not provide current support for MigLayout either.

Some brief history and net research is pertinent :

  • Support for MigLayout was requested in Netbeans at least as far back as 2007-01-28.
  • An Open-source project to do so, Project Kenai , was started in June 2009.
  • On June 16 2009, a key Netbeans Developer announced in his blog that he had created the most basic Netbeans support for MigLayout - essentially the ability to register the layoutManager under the list of possible Mangers and little more - ie step 1 of 100 and functionally almost insignificant.
  • Even this extremely rudimentary support was never introduced into Netbeans, the development requests remain open, and project Kenai has not been updated since 16 June 2009.

Realistically, given all the major bugs and limitations in the Netbeans GUI Builder Matisse (which have also remained open on the Netbeans Bugzilla site for years and years) you are unlikely to find support for SpringLayout or MigLayout in Netbeans before 2020 at the earliest, if ever.

Do not despair however. After finding this out I kept looking and found extensive support for MigLayout in Eclipse (an open-source IDE akin to Netbeans).

Not only does Eclipse contain fully-integrated detailed GUI-based selection of many (but not all) detailed MigLayout options, the WindowDesigner also has a whole range of features that as an IT developer of 35 years experience (and a 12 year user of Netbeans) that I had originally expected to find in Neteans/Matisse but had just got used to not having.

It also turns out that Eclipse's code-assistant tools are neater, cleaner, more helpful, faster, more reliable, more flexible and more comprehensive too.

Netbeans is obviously a powerful IDE/platform with many visually impressive and substantial products/systems built upon it, and it might even have support for some incredible things that are not obvious on the surface, but it looks as though the severe limitations of its core screen designer (Matisse), and the repeated pattern of not fixing fundamental problems with it for years, mean that initially at least Eclipse appears to be simply a better tool for a standard Java developer wanting to use a powerful and flexible LayoutManager (without having to write one).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM