Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » WindowsBuilder - Isolate My App Code From Gui?(Can AppCode be isolated by gui by using a subclass?)
WindowsBuilder - Isolate My App Code From Gui? [message #1824528] Fri, 17 April 2020 00:16 Go to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Rather than editing the GUI class created by the WBDesigner directly, what if I derive a class with that class as the parent? Then just copy the event handler prototypes to my code and fill in my code? I can call the parent if I need to, right?
That way compile errors in my code won't keep the designer from launching.
And I can organize my event code the way I want to without the designer re-writing it every time I run the designer.

Is this the normal way to use the WB Designer?
Anything gonna break when I do this, that we can think of?

I may be using some C++ rather than Java class terms here. I'm new to Java, but a long time C++ guy.

Thanks.
Re: WindowsBuilder - Isolate My App Code From Gui? [message #1824529 is a reply to message #1824528] Fri, 17 April 2020 04:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31152
Registered: July 2009
Senior Member
It would be better to ask on the WindowBuilder forum:

https://www.eclipse.org/forums/index.php/f/214/
Re: WindowsBuilder - Isolate My App Code From Gui? [message #1826044 is a reply to message #1824528] Fri, 17 April 2020 15:12 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Ha Ha.. Gotcha...
In Project>>Properties>>Run/Debug Settings we find the class that starts the app.
Soooooo. By overriding the class containing the gui with another class, and then putting that child class here, the child is started and can isolate the app code from the gui code in the WB class.
I was wondering how Java knew which class to instantiate and start. And it was in the obvious place. Project Properties.

So let's go see if that works.
hummm Wonder how I override a class in another package? I'd like to put the app code in another package called com.bla.app rather than com.bla.views. Well lets go find out.
Yep. I'll remember that [message #1826045 is a reply to message #1824529] Fri, 17 April 2020 15:13 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Good point. I'll remember that.
gotta include main() [message #1826050 is a reply to message #1824528] Fri, 17 April 2020 16:24 Go to previous message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Ok. Got it working.
The key is to include the main() method in the child class. At that point you can comment out the main method in the base class. The run/debug properties apparently looks for the main method, so starting the child class without main() doesn't work. Then be sure that main() in the child class instantiates the correct child class.
And away we go. App code separated from the WB gui code. Now to commit this and then add some events.
Previous Topic:Fonts in Eclipse
Next Topic:'Updating Software' has encountered a problem.
Goto Forum:
  


Current Time: Wed May 27 22:49:26 GMT 2020

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

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

Back to the top