• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating GUIs in Java?  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 56606
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 175
1
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Marshal
Posts: 56606
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sarah Alderman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Foreman
Posts: 3071
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!