Java Reference
In-Depth Information
g.drawString(“Hello Engineers, this is Java”, 50,
100);
}
//****************************
// main
//****************************
public static void main(String[] args)
{
// Create an object of the class WindowText
Text aframe = new Text();
// Use methods in superclasses to modify object's default
// size, location, and program title
aframe.setSize(500, 300); // Set frame size
aframe.setLocation(200, 100); // Set frame location
aframe.setTitle(“Text Demo Program”); // Titlebar text
// Display frame calling the show() method of the Window
// class
aframe.show();
}
}
Figure26-2 isascreensnapshotoftheTextprogram.
Figure 26-2 Snapshot of the Text.Program
On the Web
The program Text.java is located in the Chapter 26 folder at
www.crcpress.com .
 
Search WWH ::




Custom Search