Forums Register Login

Creating GUIs in Java?

+Pie Number of slices to send: Send
So yeah I have just completed a few Java tutorials including Java Tutorial for Complete Beginners (https://www.udemy.com/java-tutorial/learn/v4/content) but none of them ever touched on the subject of how to create programs with a GUI in Java.

I am pretty sure I know most of the basics associated with Java programming and was hoping to move onto understanding how programs with GUIs work and are created in Java, are there any references on this (preferably free references though not opposed to forking out a little cash for some books that cover the subject and are worth the money) subject suitable for my knowledge level or is there more that needs to be covered before learning about GUIs?
+Pie Number of slices to send: Send
 

Queen Skadi wrote:I am pretty sure I know most of the basics associated with Java programming


Hmmm. I always worry when I see statements like that.
Learning "the basics" took me about two years, and Java was my 6th major language, after more than 20 years in the IT biz.

and was hoping to move onto understanding how programs with GUIs work and are created in Java,


I'm probably the worst person to answer this, since I absolutely detest GUIs: They're verbose, fiddly, complex, distracting, and easy to get wrong - so bravo to you for wanting to learn them.

However, from what I gather, the latest and greatest is JavaFX, and you can find the "official" tutorial for it here.

As to books, I'll leave that up to others.

HIH

Winston
+Pie Number of slices to send: Send
I would suggest that GUIs are one of the less important things to learn about a language. They might be pretty, but you can get a long way without ever writing a GUI, as Winston will attest. I think Winston is right to refer you to the FX tutorial.

And welcome to the Ranch
+Pie Number of slices to send: Send
GUIs in Java can be done with swing, set, or JavaFX. Java FX is indeed the latest and is starting to replace both awt and swing.
+Pie Number of slices to send: Send
 

Naziru Gelajo wrote:. .  Java FX . . . is starting to replace both awt and swing.

JavaFX please, not Java FX.
AWT please, not awt.
Swing please, not swing.
You have gone down with a bad attack of litotes, saying, “starting to replace AWT.” Nobody has used AWT for displays for nearly fifteen years
+Pie Number of slices to send: Send
 

Winston Gutkowski wrote:

Queen Skadi wrote:I am pretty sure I know most of the basics associated with Java programming


Hmmm. I always worry when I see statements like that.
Learning "the basics" took me about two years, and Java was my 6th major language, after more than 20 years in the IT biz.



Perhaps I am just arrogant and think I know the basics, when I say basics I mean the absolute basics, variables, arrays, loops, objects and functions ect, all that good stuff, perhaps I should give a better idea of what it is I am aiming to be able to eventually do.

Basically my interests relate more to creating games and programs with an interactive and visual component, I can already make a fairly basic text based RPG (like really basic) but have no idea where to start when it comes to getting visual components to display in Java (at least not without the help of some sort of external program, engine or library).

If I am mistaken and there is more to learn before moving on to visual components then would you be kind enough to make some recommendations?

and was hoping to move onto understanding how programs with GUIs work and are created in Java,


I'm probably the worst person to answer this, since I absolutely detest GUIs: They're verbose, fiddly, complex, distracting, and easy to get wrong - so bravo to you for wanting to learn them.

However, from what I gather, the latest and greatest is JavaFX, and you can find the "official" tutorial for it here.

As to books, I'll leave that up to others.

HIH

Winston



Hmm I understand that programming with an extended library makes things a lot easier however I was kind of hoping to learn how to implement a GUI without having to rely on an external library if that is even possible?
+Pie Number of slices to send: Send
One thing you need to be confident about when doing GUI stuff in Java is your code structure.
I've seen too much code written by people jumping into GUIs before they understood how to break up their code into suitable parts.

I say this because the structure of the various GUI frameworks expect you to understand how callbacks, listeners, threading, OO in general all work together.

But!
Go through the tutorial that Winston linked to for JavaFX.  They're good docs, but they do rely on some knowledge of the above.
Just don't chuck all your code into a single class...or worse method.
Think in terms of MVC, even if it's a slightly scrappy version of it.
Pay attention! Tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 498 times.
Similar Threads
what methods of learning has worked for you?
Requirements for building Java GUI to access MySQL Database
Here You Will Find Links To Free Stuff
Software Architecture toolbox
i dont know where to look
Thread Boost feature
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:27:48.