O'Reilly logo

Inside XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Java Classes

We've already seen how to create classes in a rudimentary way: You need to create a class to do anything at all, as when we created the main class for the applications that we've built:

public class app
{
    public static void main(String[] args)
    {
        System.out.println("Welcome to Java");
    }
}

In preparation for the next chapter, let's take a look at a more advanced example. In this case, I'll create a new class named AppFrame based on the Java Frame class, which is what you use to create frame windows (a frame window has a frame, including a border and title bar) in Java. There are two ways to work with graphics in Java: the Abstract Windowing Toolkit (AWT) and the Swing Java packages. In the interests of space, I'm going to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required