I have just started a Java GUI and I set up a background image in the Gefram by riding more of the Paint Component (Graphics G) method. So that I can combine baby components on the image. I have looked at other answers but the code is very complex for beginners
How can it be understood that use the following code:
public class employee GUI Enhances JFrame {public employee GUI () {super ("employee management"); This.setVisible (true); This.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); This.setLocationRelativeTo (zero); This.setResizable (wrong); This.pack (); }}
The frame is always done on the content pane of the frame. There is also the content panel where components are added. MyContentPane
loads a BufferedImage
with a given path If it is loading, then a blue rectangular image is created as. By setting up the content pane in your example code for an example of MyContentPane
, you create the full internal area of the MyContentPane
frame.
No comments:
Post a Comment