• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to move collapsed source code from GUI builder back into the GUI builder?

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I find the GUI builder not possible to convert
say
private void initComponents()
to
protected void initComponents()

So I decided to collapse the source code to plain java class, after a while, some fields are to be added. So I can no longer
maintain the collapsed source code, and want to un-collapse the java class to the GUI builder again.
Is it possible?
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly what do you mean be "collapsed source code"? Are you using those IDE GUI code generator? If so you shouldn't. It is better to write your own GUI code.

When you did
private void initComponents()
to
protected void initComponents()

you are simply changing the access modifier for that method.


Also how are you building your GUI? One big class or each component has its own class or something else?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I moved this thread out of the Swing/SWT forum because it's about how to do things in some GUI builder in some IDE. I'm guessing that IDE might be NetBeans but it would be helpful if you provided that information.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:Exactly what do you mean be "collapsed source code"? Are you using those IDE GUI code generator? If so you shouldn't. It is better to write your own GUI code.

When you did
private void initComponents()
to
protected void initComponents()

you are simply changing the access modifier for that method.


Also how are you building your GUI? One big class or each component has its own class or something else?



By Collasped code, I mean when the GUI builder is functioning, the methods like initComponents are locked,
when I copy the code over to another class, it is unlocked, I reckon it is not possible to move the unlocked code into GUI builder again
But I had a hard time understanding the GroupLayout.
Thanks
Jack
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do yourself a huge favor and drop the GUI Builder like a plague. Like K. Tsang correctly recommended, write your GUI code by hand.

But I had a hard time understanding the GroupLayout.


No surprises there. It is intended to be used by the GUI Builders.
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic