wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Adding components to JFrame in Netbeans Swing GUI Builder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Adding components to JFrame in Netbeans Swing GUI Builder" Watch "Adding components to JFrame in Netbeans Swing GUI Builder" New topic
Author

Adding components to JFrame in Netbeans Swing GUI Builder

dinesh maddy
Greenhorn

Joined: Mar 30, 2012
Posts: 6
I am trying to create my application using Netbeans GUI Builder, but I have a situation here.

When I drag and drop a component(Jlabel or any other used defined component) to JPanel from Palette window of GUI Builder, the Java code is automatically added by the Netbeans. For eg. the following code is generated:


Now I have a ArrayList which need to store the component objct which is added by GUIBuilder. In this case the object added is jLabel1.


So I need to store this object in this ArrayList. Infact I need the new component object to be automatically added to this list, whenever a new component is added by GUIBuilder.

Since GUIBuilder generates the Java code for added component automatically, how do I make GUIBuilder to update this ArrayList automatically whenever a new component is added?

Can anybody please help me to figure this out?

Thanks in advance.
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 154
crossposted on SO
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Hi dinesh,
If you are posting the query in more than one forum, please be forthright about it: BeForthrightWhenCrossPostingToOtherSites

As for your question - this is not possible using the GUI builder. Simply code by hand and you can control it.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Adding components to JFrame in Netbeans Swing GUI Builder
 
Similar Threads
Making a GUI run and displaying data from a program that is already created.
Strange LAYOUT !!!
frame .exit or dispose
problem adding JScrollPane to JTextArea
Getting my main class and GUI components to talk without inner classes