Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating WindowBuilder into an existing eclipse project

I am working on an assignment that requires a UI. I use Eclipse and already have WindowBuilder up and running. A few weeks ago, I created a WindowBuilder SWT project to create my GUI. I did nothing more than layout the elements to get a visual copy of what it would look like, but had no additional code for doing anything.

Since then, I have written most of this code in a separate Eclipse project, one that is not set up as a WindowBuilder project and is also synchronized with Github. I am trying to import my existing WindowBuilder UI into this project, but am running into some problems. At first, I just tried copying the JAVA file over, but I get a ton of errors about missing dependencies. It looks like the WindowBuilder project had a bunch of Referenced Libraries that the normal project does not.

Anyway, is there an easy way to add WindowBuilder capability to an existing project? This would be much much easier than trying to move my existing project into my WindowBuilder project. Any help with this would be great appreciated. Thanks!

like image 267
user2271605 Avatar asked Mar 24 '23 08:03

user2271605


1 Answers

is there an easy way to add WindowBuilder capability to an existing project?

Yes,

select the class which you want to open using WindowBuilder and

right click -> Open With -> WindowBuilder Editor

In your case, I would go ahead and simply create a new class within your second project, copy paste all the code from the old WindowBuilder Class into the new class and the enable WindowBuilder Editor using the step above. (Crude but gets the job done).

In order to quickly organize all your missing imports from an existing project you can use:

Ctrl+shift+o 

As to any missing libraries in the future, you mentioned using GIT. On the machine where those libraries are present in your project:

right click (the libraries) -> Team -> add to index 

Then commit and push. Pull on your other machine and you should have them.

like image 139
Vortex Avatar answered Apr 06 '23 02:04

Vortex