7/2/2023 0 Comments Java lwjgl draw circleThreads allow a program to start several executions at the same time. What is a thread in java?Ī program is executed by just one processor, line by line. In the first java versions only AWT existed and then Swing was added. We will call this engine "AWT Engine" or "Swing Engine" because it is made by these two libraries. This engine communicates with the operative system both to paint in the screen as to receive information from the keyboard and from the mouse. When we create a JFrame object we start an engine which manages the user interface. With these few instructions we will obtain a window which can be maximize, minimize, change it´s size with the mouse, etc. JFrame frame = new JFrame("Mini Tennis") įtDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) If we don´t include the last line "tDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)", when we close the window the program won´t finish and will continue running. The window won´t be visible until we call setVisible(true). The following code creates a window "Mini Tennis" of 300 pixels by 300 pixels.
0 Comments
Leave a Reply. |