How can I create a cross-platform Java graphical application (Windows, Linux)? What tools should be used?

I am new to Java GUI programming, and I want to make a Java GUI application that can run on both Windows and Linux with the same code (same executable / object).

Is this possible without compatibility / error / error issues?

What else (e.g. libraries, classes, packages) will I need to be able to design a GUI in Java?

Should these libraries be present on every computer and every OS so that the application can work? Or is there enough Java Virtual Machine (JVM) installed on the computer?

+7
java user-interface linux windows cross-platform
source share
5 answers

Swing is an environment that can help you write graphical applications in Java. Check out Oracle's Swing tutorial: http://docs.oracle.com/javase/tutorial/uiswing/

About platform compatibility: Most Linux distributions install OpenJDK (the open source Java alternative) as the default Java compiler. Basically, this works great with a program written using Oracle JDK. But if you want to be sure, you can also install Oracle JDK on Linux.

About IDE Development: Eclipse and Netbeans are available on different platforms, including Windows and Linux.

+4
source share

Swing will do it for you. This is not as good as its own user interface, but it works well and does not require any third-party libraries: http://docs.oracle.com/javase/tutorial/uiswing/

+1
source share
  • Before worrying about a nice GUI, you should get a deeper understanding of Java.
  • Java is always platform independent unless you use any special native libraries.
  • I recommend coding the GUI yourself. I don’t even know if there are some GUI wizards. I recommend Eclipse, but it is purely opinion-based ...
  • To get a cross-platform GUI that looks like a native program on each platform that you left on the same, I would recommend the Swing toolkit ( javax.swing.* Already included in the JRE / JDK)
+1
source share

You can use the Eclipse IDE, and for the GUI you can use either SWT or XWT

+1
source share

To run the java program, you need an interpreter (Java virtual machine) installed on the computer, so it can be transferred to any OS while the JVM is installed.

Eclipse is a good development environment.

The GUI is too advanced, but mostly AWT and Swing packages.

0
source share

All Articles