@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  if (m_Background != null) {
    g.setColor(Color.WHITE);
    g.clearRect(0,0,getWidth(),getHeight());
    int width=m_Background.getWidth(null);
    int height=m_Background.getHeight(null);
    int x=(getWidth() - width) / 2;
    int y=(getHeight() - height) / 2;
    g.drawImage(m_Background,x,y,width,height,this);
  }
}

@ Override public void paintComponent ( Graphics g ) { super . paintComponent ( g ) ; if ( m_Background != null ) { g . setColor ( Color . WHITE ) ; g . clearRect ( 0 , 0 , getWidth ( ) , getHeight ( ) ) ; int width = m_Background . getWidth ( null ) ; int height = m_Background . getHeight ( null ) ; int x = ( getWidth ( ) - width ) / 2 ; int y = ( getHeight ( ) - height ) / 2 ; g . drawImage ( m_Background , x , y , width , height , this ) ; } }
draws the background image .
