我把它放在main方法中,但背景不会显示。是否有绘制图像,我必须放在它后面或什么东西来进行背景显示?
//background image
JLabel contentPane = new JLabel ();
JFrame frame = new JFrame ();
contentPane.setIcon (new ImageIcon ("background.png"));
contentPane.setLayout (new BorderLayout ());
frame.setContentPane (contentPane);