This chapter focuses on how to write a program that defines the size and position of the window on the screen: How to display text in a variety of fonts in a window, and how to display the image three questions unfold.
For an excellent application, Carcass says, a good graphical user interface is essential, and if the lack of a good graphical user window will give the customer an understanding and a lot of inconvenience to the application. The Java Abstract Window tool AWT and component set swing contains a number of classes that support the design of graphical user interface GUIs.
Most swing component classes start with "J". If you forget to write "J" although it can still be compiled and run, but if you encounter the simultaneous use of AWT will result in visual and behavioral mixing. There are setlocation and SetBounds methods for setting up the framework. Then call the static method of the Toolkit class Getdefaulttoolkit get a Toolkit object, and then call the Getscreensize method, this method will return the size of the screen in the form of dimension object to determine the size of the text box.
The Graphics object in Java contains a method for drawing patterns, images, and text, which is widely used, almost all of which relate to drawing I. (Here's a question you don't understand: Why JComponent class to cover the Paintcomponent method?) What happens if I don't overwrite it? )
201671010135 2016--2017--"Java Programming: Graphic Programming"