Search code examples
javauser-interfacefile-type

When to use a Java GUI


Possible Duplicate:
How can I convert my Java program to an .exe file?
Compiling a java program into an exe

I believe this is an easy question, though I cannot find a quick answer.

I've been learning in a Java class about GUI making (and really Java coding in general) which, when compiled, creates a .java file. That .java file can be opened with some sort of IDE but not just opened like a .exe file.

This brings me to my question. When/where do you actually use a Java GUI? I don't foresee me passing out .java files for my friends or co-workers to use the tools I've made. Are they supposed to work best with online applications?


Solution

  • A .java file is source code which is meant for a programmer to write code in a format suitable to them, to define the behaviour of the program.

    Source code is compiled into .class files which you can execute (run), although they are often packaged into JAR files (which are simply collections of .class files).

    These can be executable and can be passed between people to share programs.

    GUIs are irrelevant. You can either create a GUI or not, but the functionality will still exist in the code and can be executable. GUIs allow you to view and interact with a program, whereas without a GUI you have to use the command line if interaction is required.