201671010135 2016--2017--"Java Programming: Graphic Programming"

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.