• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Adding components to JFrame in Netbeans Swing GUI Builder

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
crossposted on SO
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic