File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes NetBeans GUI - nested JPanel design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "NetBeans GUI - nested JPanel design" Watch "NetBeans GUI - nested JPanel design" New topic
Author

NetBeans GUI - nested JPanel design

Robert Haynes
Greenhorn

Joined: Mar 09, 2012
Posts: 12
I am attempting to generate the GUI for some simple components that I can reuse in the palette manager of NetBeans. I have written the simple JPanel component manually and it works fine and now trying to convert it in to NetBeans GUI. While the code may not be identical, one portion is driving be bonkers as I can not determine where to make the change.

The manual code is:


The GUI builder is generating:


The ADD statement is the concern. There is no option that I am able to locate that allows me to modify the ADD function. I selected the parent panel and child component, but to no avail on locating anything that will modify the ADD statement.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4522
    
    5

Since your question is related to the use of the NetBeans IDE, rather than Swing per se, I'm moving it to a more appropriate section.

I will remark, though, that a visual designer isn't a beginner's tool and IMO is only worthwhile learning if you intend to make a career of GUI design. Straightforward Swing coding I find an order of magnitude easier.


luck, db
There are no new questions, but there may be new answers.
Robert Haynes
Greenhorn

Joined: Mar 09, 2012
Posts: 12
Having been developing other languages for years, Java itself is new. As you mentioned, IDE's are not a beginner's tool (nor new to me) though I did only focus on using it for Java after messing with the manual code for a few weeks now. Much to my liking and dismay (because I posted this), I think I have figured it out. To assist others that might have this issue...

The parent container was still defined as Flow Layout. Once updating the parent container, the component properties now displayed a section for "Layout" that enabled me to choose the direction. Now the IDE generated code shows.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4634
    
    5

Robert Haynes wrote:Having been developing other languages for years, Java itself is new


Since you are someone experienced with other languages, here is my big tip: don't waste much time with the Java GUI stuff.
The Java GUI code was quickly slapped onto Java back in ancient times. Its not a good interface. Its not used much, either. Most folks
either write Web applications, so the browser does the GUI stuff, or they use a more specialized toolkit (like for Android).

Frankly, the Java GUI tools are crude, and the IDE support for them is crude, mostly IMHO because not many people rely upon them.

The whole "layout" design and karma tried to do a useful thing, let the presentation be controlled by the device, so it could be device, screen, resolution, etc. independent. But like many "cross platform" ideas, its better in theory than in practice.

Its not just in Java. Listen to the IOS developer now that the newest IPAD has a totally different screen resolution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NetBeans GUI - nested JPanel design
 
Similar Threads
Graphics2D window not being repaired?
Convert Swing frame+label to Applet?
Netbeans 5 : add component using addLayoutComponent() problem
itemstatechanged event on Jcombobox
Using custom panel in NetBeans GUI builder