Window for GUI Programming

Source: Internet
Author: User

To be honest, I have been studying programming for half a year. Since I 've learned algorithms, I think programming languages are all the same, and I have never seen C ++, but many of the things in STL have come into contact, after all, I want to learn it now when I use it. In general, I understand it. But from the very beginning, I didn't like programming in that black box. I always felt that it was not cool enough, I thought that the powerful object-oriented language of Java would satisfy me, but after reading the basic syntax of Java, I found that it is similar to that of C, of course, this similarity does not mean similar writing .. Now we have prepared a hardware gui (graphic interface programming). Good luck to me.

Today's learning window, for the graphic interface, the window is undoubtedly the most basic container. To learn the GUI, most of the classes to be called are in the swing class.

Import javax. swing. *; import static javax. swing. jframe. *; // introduce the static variable public class gui_window {public static void main (string [] ARGs) {jframe W1 = new jframe ("Hello world! "); // Create a title-included window w1.setbounds (60,100,280,200); // set the initial position of the window w1.setvisible (true); // set the window to be visible, w1.setdefaclocloseoperation (exit_on_close) is not visible by default. // set the response after the window close button is clicked. The next statement is to end the application }}

Effect:

Window for GUI 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.