Skip to main content



      Home
Home » Eclipse Projects » WindowBuilder » Control declaration ordering
Control declaration ordering [message #753382] Wed, 26 October 2011 19:48 Go to next message
Eclipse UserFriend
Hi everyone,

I program with Java but the jobs I do run in batch mode so I have not been able to get into the WindowBuilder GUI and so I decided to do so on my own. Everything is loaded and running fine; however...

To familiarize myself with a first program, I created an JFace/ApplicationWindow project with a push button and a label. I used the buttonUp event to invert the visiblity of the label with each click. In the WindowsBuilder generated code, the label is declared after the button making it necessary for me to rearrange the code for my example to work.

Is this a necessary step or am I missing something?

Thanx,
Bill
Re: Control declaration ordering [message #753383 is a reply to message #753382] Wed, 26 October 2011 20:06 Go to previous messageGo to next message
Eclipse UserFriend
Sounds like you should have the label defined as a field so you can refer to it from the button.
Re: Control declaration ordering [message #753384 is a reply to message #753383] Wed, 26 October 2011 20:11 Go to previous messageGo to next message
Eclipse UserFriend
Thanks very much for the quick response. Would you elaborate a bit on what you mean by field? I am not a GUI type.

Thanx,
Bill
Re: Control declaration ordering [message #753385 is a reply to message #753384] Wed, 26 October 2011 20:23 Go to previous messageGo to next message
Eclipse UserFriend
You should have the widget assigned to a field rather than a local variable. Any widget that you want to reference programmatically should be a field.
Re: Control declaration ordering [message #753391 is a reply to message #753385] Wed, 26 October 2011 21:03 Go to previous messageGo to next message
Eclipse UserFriend
I got it, thank you. I didn't know about the "convert to field" button.

Re: Control declaration ordering [message #753397 is a reply to message #753391] Thu, 27 October 2011 00:15 Go to previous message
Eclipse UserFriend
There are also code gen options to create all widgets as fields if you prefer.
Previous Topic:initDataBinding called at design time in nested composites
Next Topic:Adding support for Scala/Groovy/etc.
Goto Forum:
  


Current Time: Wed Jul 23 10:34:59 EDT 2025

Powered by FUDForum. Page generated in 0.06202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top