r/javahelp • • May 03 '19

Homework How exactly do I make a GUI? (Java)

Hi guys, for the end of the year I need to make a GUI. The teacher doesn’t tell you how but wants you to do it on your own and gave us basic instructions but didn’t tell me WHERE I actually make it. Do I use netbeans to do it or Alice? That’s all I need honestly. From there i can manage by myself. Thank you.

Also this is an intro to java class so nothing fancy.

16 Upvotes

9 comments sorted by

2

u/[deleted] May 03 '19

Netbeans has a gui builder for swing that you can use. You'll still need to do abit of reading about swing and how it works though (and check out some simple example programs)

2

u/thanhnienverchuan May 04 '19

You can make a GUI with Swing or JavaFX. I prefer JavaFX than Swing. You can find some tutorials via YouTube

2

u/mansoormehraban May 04 '19

Download java fx and scene builder. Create a java fx project and connect scenebuilder to the project file...thats to get started.

Follow some tutorials to continue building your app.

1

u/kiwidog8 May 03 '19

Did a quick search and found this post from 3 years ago but I'm sure it will still be helpful. What's the actual modern way to make a GUI with Java?

Just like you were taught to use the standard libraries (or packages, whatever you prefer to call them) such as java.utils or java.io to import classes that help you write command line applications for your exercises (assuming that's what you've been doing), you will similarly use those libraries mentioned in that post to add in a graphical user interface.

0

u/[deleted] May 03 '19

Try starting here: https://www.javatpoint.com/java-swing and look down the page where it says "Simple Java Swing Example"

0

u/[deleted] May 03 '19

[deleted]

0

u/[deleted] May 03 '19

[deleted]

10

u/[deleted] May 03 '19

Actually that's not a problem (and it was already separated from Java as of JDK 11)

JavaFX now being in openjfx is most likely going to be better for the development than it was getting before. The Separation means little more complicated out of the gate in getting started, but in the long run it's going to be better

6

u/Cucumberino May 03 '19 edited May 03 '19

It's not included in the JDK already for the newer Java releases, but that doesn't really impact anything. JavaFX is probably a better option for a new project unless you specifically want to learn swing or it has to be swing either way.

4

u/deltageek Extreme Brewer May 04 '19

Correction: Oracle isn't supporting JavaFX in the future. It'll be maintained by its own open source team from now on and is being packaged separately from the JVM.