private void onResized(){
  Dimension screenSize=stendhal.getDisplaySize();
  sw=getWidth();
  sh=getHeight();
  if (useScaling) {
    double xScale=sw / screenSize.getWidth();
    double yScale=sh / screenSize.getHeight();
    scale=Math.max(xScale,yScale);
    if (Math.abs(scale - 1.0) > 0.0001) {
      useTripleBuffer=true;
    }
 else {
      useTripleBuffer=false;
      buffer=null;
    }
  }
 else {
    sw=Math.min(sw,screenSize.width);
    sh=Math.min(sh,screenSize.height);
    useTripleBuffer=false;
    buffer=null;
  }
  calculateView(x,y);
  center();
}

private void onResized ( ) { Dimension screenSize = stendhal . getDisplaySize ( ) ; sw = getWidth ( ) ; sh = getHeight ( ) ; if ( useScaling ) { double xScale = sw / screenSize . getWidth ( ) ; double yScale = sh / screenSize . getHeight ( ) ; scale = Math . max ( xScale , yScale ) ; if ( Math . abs ( scale - 1.0 ) > 0.0001 ) { useTripleBuffer = true ; } else { useTripleBuffer = false ; buffer = null ; } } else { sw = Math . min ( sw , screenSize . width ) ; sh = Math . min ( sh , screenSize . height ) ; useTripleBuffer = false ; buffer = null ; } calculateView ( x , y ) ; center ( ) ; }
the canvas can be resized using a split pane , or with window size changes if screen scaling is used . this is for adjusting the internal parameters for the change .
