How can I use eclipse to create a GUI? (I want to use only swing / awt and other packages)

I usually write Java code using a simple text editor and .bat files to compile and run. I'm not used to an IDE like Eclipse or Netbeans, and as a result, every GUI that I have done so far has been manually written.

Questions:

  • Is it possible to use eclipse to easily create a graphical interface (for example, drag and drop functions)?

  • Can this generated code use only the basic java packages (swing, awt), and not any other package provided by the IDE?

I say this because - correct me if I'm wrong - from what I have read so far, I understand that Eclipse and other IDEs use their own packages (for example, to achieve better layouts). I would like to avoid this dependency and, if possible, copy-paste the code generated by Eclipse, and then work in a simple way that I'm used to.

Thanks in advance.

[edit]
After trying it for a couple of days, I can now say that WindowsBuilder is exactly what I was looking for. Thank you for all your answers.

+6
source share
5 answers

Eclipse uses a set of standard widgets (SWT, not included in the JRE by default), Netbeans uses Swing (included).
Starting with the latest versions of Eclipse, it includes WindowBuilder for creating Swing or SWT using drag'n'drop. WindowBuilder is even bi-directional, so code generation is supported, and manual changes are also reflected. He does not know if Netbeans includes this feature. In the New Eclipse dialog box, you will find everything you need in the WindowBuilder category.

+8
source

Is it possible to use eclipse to easily create a GUI (e.g. drag and drop function)?

Yes, go to the Marketplace and pull WindowsBuilder; It supports bidirectional GUI editing drag-n-drop / direct-code.

Can this generated code use only the basic java packages (swing, awt), and not any other package provided by the IDE?

The code generated by the Swing Design tool is strictly based on Swing / AWT.

He also offers design tools for SWT and GWT.

+2
source

Yes, you can use the drag and drop function in java by going through these few steps:

Help β†’ Eclipse MarketPlace β†’ WindowBuilder (Install)

+2
source

If you want to create a Drag In Drop Swing GUI, you should try Netbeans. Eclipse may have a plugin, but I usually find netbeans very good in the GUI, and Sun is also recommended for creating a Swing / AWT GUI

+1
source

I have not seen such in Eclipse. At Netbeans you can, of course. But I warn you! Create a GUI manually. Netbeans uses GroupLayout to create a drag-and-drop GUI, and it's a nightmare when you look at it !!! If an eclipse has the same function, do not expect more! Also, not like .NET, most Java developers create everything manually (yes, real programming .. That's why most say Java is difficult). So, it is better if you can get used to it :)

0
source

Source: https://habr.com/ru/post/921613/


All Articles