One aspect that I haven't touched on yet is Java UI (User Interface). I left this topic out of all the previous tutorials on purpose, because I think it's one of Java's weak points. If you're reading this and you disagree, then that's great, I'd love to hear your thoughts on the positive aspects of Java UI, please leave them in the comments section at the end of this post.

First of all, what is a User Interface?

You may have noticed that, so far, there has been no real “interaction” between you and the code you've been writing. All that happens is you say “Run as Java Application” and then your code may output something into the console. But then your program ends and that's it! There hasn't been any real interaction with you while the program is running. This is where a User Interface becomes really crucial.

An example of a User Interface is a window (or dialog) that displays a form on your screen. This form has fields for you to fill out, like username and password. You have the ability to type in your username/password combination, then hit a “submit” button, and then the program will spring to life and verify that your username/password is indeed correct. THIS interaction is made possible by a User Interface.

Why do I think Java UI is weak?

I have two main reasons why I dislike Java UI in general:

  1. It's not very pretty
  2. It's confusing

I realize these two reasons aren't the most compelling reasons for disliking all things Java UI, but it was compelling enough for me and every one of my University computer science friends to use something else! Plus when it comes down to it, most applications you use on a daily basis are NOT using Java UI… that's because they're either web applications (like Facebook or Kijiji) or just built on some other products (like Visual Studio).

If you would like to see a sample of what this Java UI is all about, here's a tutorial that covers one of the methods for creating a UI. This framework is known as Swing:

Another UI tool is called AWT or Abstract Window Toolkit and Sun has a pretty comprehensive tutorial:

What UI should I use then?

Well here's where it gets a bit tricky. You see I am a web application developer, and therefore I do almost all of my work for web applications. So I am very comfortable using the web as my Graphical User Interface. In order to do this yourself, you'll have to learn how to use webpages as your UI. This is where HTML comes in!

What is HTML?

HTML stands for Hyper Text Markup Language, and all it does is define a language that allows you to talk to internet browsers (like Internet Explorer, Google Chrome or Firefox). If you understand “how to program with HTML”, then you can create some great user interfaces for your audience… well… so long as you're also good at knowing what a good website looks like. If you're like me, most programmers aren't designers! I may know how to code, but to make a website LOOK good may take me just as long as creating all of the functionality for the website!

HTML is nowhere near as complex or difficult as Java programming and it's MUCH easier to get started with creating your first webpage using HTML than creating your first Java program. So no worries ladies and gentlemen, with my guidance, you could be an HTML rock star in a few weeks!

In any case I don't want to start teaching HTML just yet, as I want to focus on Java. My goal for this blog is to eventually grow this tutorial series to a point where you could build your own web application. This would mean you'll eventually be learning some HTML, so stay with me on this journey guys! And if you want to learn more about Java UIs and HTML, these are topics we cover and more in our Java Bootcamp. Enrollment is re-opening soon.


Free Java Roadmap

Discover exactly what you need to learn and where to start in order to become a professional coder.