如何从injavax.swing中放入图片

时间:2013-08-03 12:24:58

标签: swing

如何在JFrame中反映图片/图像文件? javax.swing或java.awt中是否有任何组件?

JFrame frame = new JFrame();
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.setLayout( new GroupLayout( getContentPane() ) );
frame.setSize( new Dimension( 600, 480 ) );
frame.setLocationRelativeTo( null ); 
frame.getContentPane().setBackground( Color.LIGHT_GRAY );

// add Image container !!!

frame.setVisible( true )

0 个答案:

没有答案