1     private Image backgroundImage = new ImageIcon(this.getClass().getResource("/images/beijingtupian.jpg")).getImage();  
2     public JPanel eastScrollPanel = new JPanel(){
3         private static final long serialVersionUID = 1L;    
4 
5         public void paintComponent(Graphics g) {
6              g.drawImage(backgroundImage, 0, 0, this);
7         }
8     };

 

相关文章: