String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCase("backingstore")) myScrollMode = BACKINGSTORE_SCROLL_MODE; else myScrollMode = BLIT_SCROLL_MODE; setScrollMode(myScrollMode);
setScrollMode(defaultScrollMode);
  public JViewport()  {    setOpaque(true);    String scrollModeProp =      System.getProperty("gnu.javax.swing.JViewport.scrollMode",                         "BLIT");    int myScrollMode;    if (scrollModeProp.equalsIgnoreCase("simple"))      myScrollMode = SIMPLE_SCROLL_MODE;    else if (scrollModeProp.equalsIgnoreCase("backingstore"))      myScrollMode = BACKINGSTORE_SCROLL_MODE;    else      myScrollMode = BLIT_SCROLL_MODE;    setScrollMode(myScrollMode);    updateUI();    setLayout(createLayoutManager());    lastPaintPosition = new Point();    cachedBlitFrom = new Point();    cachedBlitTo = new Point();    cachedBlitSize = new Dimension();    cachedBlitPaint = new Rectangle();  }