Return to site

Java swing project example

broken image
broken image

Most of the AWT UI components have become obsolete and should be replaced by newer Swing UI components. There are current three sets of Java APIs for graphics programming: AWT ( Abstract Windowing Toolkit), Swing and JavaFX. I will describe another important OO concept called nested class (or inner class) in this article. I shall assume that you have a good grasp of OOP, including composition, inheritance, polymorphism, abstract class and interface otherwise, read the earlier articles. However, re-using them are not so difficult, if you follow the API documentation, samples and templates provided. Writing your own graphics classes (and re-inventing the wheels) is mission impossible! These graphics classes, developed by expert programmers, are highly complex and involve many advanced design patterns. In this article, I shall show you how you can reuse the graphics classes provided in JDK for constructing your own Graphical User Interface (GUI) applications. These classes are self-contained and are reusable.

broken image

You can create high-level abstract data types called classes to mimic real-life things. As discussed, OOP permits higher level of abstraction than traditional Procedural-Oriented Languages (such as C).

broken image

So far, we have covered the basic programming constructs (such as variables, data types, decision, loop, array and method) and introduced the important concept of Object-Oriented Programming (OOP).

broken image