Java Graphical User Interface: An introduction

by FossilizedCarlos on February 19, 2012

The Java language was born out of a need for a single program to be able to be compiled, and ran on multiple operating systems. The Java language was launched in 1995 by Sun Microsystems, and derived much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. The language would compile into byte code that could be run in the Java Virtual Machine (JVM), regardless of your operating system. Java still faced a problem though, how do you write a program where the windowing system will match that of the operating system running it?

This is where the Abstract Windows Toolkit (AWT) stepped in, and became Java’s original platform-independent windowing, graphics, and user-interface widget toolkit. The AWT is now part of the Java Foundation Classes (JFC) — the standard API for providing a Java graphical user interface (GUI) for a program. AWT provided Java with the look and feel of the operating system in which it was running. The Java 2 (J2SE 1.2) saw the addition of the Swing toolkit, which largely superseded the AWT’s widgets. In addition to providing a richer set of UI widgets, Swing draws its own widgets instead of relying on the operating system’s high-level user interface module. Swing provides the option of using either a system “look and feel” which uses the native platform’s look and feel, or a cross-platform look and feel (the “Java Look and Feel”) that looks the same on all platforms. However, Swing relies on AWT for its interface to the native windowing-system.

This series will encompass most of the classes that can be used in the creation of a Java Graphical User Interface, and the code base will grow to show the additional features added. The series will begin with the following classes:

  • JFrame
  • JPanel
  • Layout Managers
    • FlowLayout
    • GridLayout
    • BorderLayout
    • GridBagLayout
  • JButton
  • JSlider
  • ActionListerner
  • MouseListener
  • ChangeListener

…and more will be added as the series grows

Java [Wikipedia]
Abstract Window Toolkit [Wikipedia]
Java Swing [Wikipedia]

Algorithm Analysis: An Introduction

January 8, 2012

Algorithm analysis is an important topic in all aspects of computer science and many other fields, as it can affect your programs complexity and overall performance. The purpose of this series is to slightly cover some of the introductory concepts related to algorithms, and delve into a selection of sorts, searches, and a couple of […]

Read the full article →

Upcoming in 2012: Goals, Wants, and Needs

January 1, 2012

Woke up too early… It is 0400, and 2012 has barely started. This year is full of opportunities for me, as I graduate in May and begin my full-time employment with a great company. I hope to continue to grow this site as it will keep my computer skills sharp, as my job will revolve […]

Read the full article →