Java Programamers - help me learn.

notfred

Lifer
Feb 12, 2001
38,241
4
0
OK, I'm new to java, but not new to OOP, I'm coming w/ a background in C++, however, only command line apps. I got my first hello world java app to compile and run from the command line, and now I want to do the same thing in a GUI window. All I want to do is open up a window that says "Hello World" and sits there until you close the window, which exits the app. I don't have any idea of the classes and methods required to do this, though. Any help or tutorials or links would be apprecaited. There's probably a "Create Window" class, or something similar, but I don't know where to look. Sun's site hasn't been real helpful. Thanks.
 

FeathersMcGraw

Diamond Member
Oct 17, 2001
4,041
1
0
Originally posted by: notfred
OK, I'm new to java, but not new to OOP, I'm coming w/ a background in C++, however, only command line apps. I got my first hello world java app to compile and run from the command line, and now I want to do the same thing in a GUI window. All I want to do is open up a window that says "Hello World" and sits there until you close the window, which exits the app. I don't have any idea of the classes and methods required to do this, though. Any help or tutorials or links would be apprecaited. There's probably a "Create Window" class, or something similar, but I don't know where to look. Sun's site hasn't been real helpful. Thanks.

You want to search the web for tutorials on "Swing" (there's also an older technology called AWT, on which Swing is based, but it's probably not too useful delving into that in depth since it's a more limited widget set). There's a good one at java.sun.com as part of the Java tutorial.

The relevant classes are JFrame, JLabel, WindowEvent, and WindowEventListener.