Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a Java cross-platform GUI application (Windows, Linux)? What tools should I use? [closed]

I'm new to Java GUI programming and I want to make a Java GUI application which can run both in Windows and Linux with the same code (the same executable/object file).

Is that possible without any compatibility problems/errors/bugs?

What else (like libraries, classes, packets) will I need to be able to design the GUI in Java?

Should these libraries be present in every computer and every OS to be able for the application to run? Or the Java Virtual Machine (JVM) installed on a computer is enough?

like image 503
MinimalTech Avatar asked Jan 17 '14 19:01

MinimalTech


People also ask

Which technologies can be used to develop GUI using Java?

To create the GUI, you use the Java Foundation Classes/Swing (JFC/Swing) and Abstract Window Toolkit (AWT) API. The many classes and interfaces in those packages allow you to easily create buttons, check-box objects, text fields, and other components, as well as components to organize them.

What is cross platform GUI?

August 4, 2022. A cross-platform GUI is a great tool for designing apps and software that can run seamlessly on: Android, iOS, macOS, Windows, and Linux. So why create apps for different platforms when you can make one for all in less effort and expense?


2 Answers

Swing is the framework that can help you write GUI applications in Java. Have a look at the Swing tutorial from Oracle: http://docs.oracle.com/javase/tutorial/uiswing/

About platform compatibility: Most Linux distribution installs OpenJDK (open source alternative of Java) as default Java compiler. Mostly it works fine with the program written with Oracle JDK. But if you want to be sure, you can install Oracle JDK on Linux too.

About development IDE: Eclipse and Netbeans are both available across multiple platforms including Windows and Linux.

like image 86
Jignesh Vasoya Avatar answered Oct 13 '22 16:10

Jignesh Vasoya


  1. Before bothering about nice GUI's you should get yourselfs a deeper insight into Java.
  2. Java is always platform independent if you aren't using any special native libraries.
  3. I recommend coding the GUI yourself. I don't even know whether there are some GUI wizards. I recommend Eclipse, but that's purely opinion based...
  4. To get a cross-platform GUI which looks on every platform as a native program yould on the same, I'd recommend the Swing toolkit (javax.swing.*, already included into JRE/JDK)
like image 29
s3lph Avatar answered Oct 13 '22 16:10

s3lph