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