ui/src/main/java/ucar/nc2/ui/widget/IndependentDialog.java
@Override
  public void setBounds(Rectangle r) {
    // keep window on the screen
    Rectangle screenSize = ScreenUtils.getScreenVirtualSize();
    Rectangle result = r.intersection(screenSize);
    if (!result.isEmpty())
      super.setBounds(result);
  }
@Override
  public void setBounds(Rectangle r) {
    // keep window on the screen
    Rectangle screenSize = ScreenUtils.getScreenVirtualSize();
    Rectangle result = r.intersection(screenSize);
    if (!result.isEmpty())
      super.setBounds(result);
  }
@ Override public void setBounds ( Rectangle r ) { // keep window on the screen Rectangle screenSize = ScreenUtils . getScreenVirtualSize ( ) ; Rectangle result = r . intersection ( screenSize ) ; if ( ! result . isEmpty ( ) ) super . setBounds ( result ) ; }
/* @Override
public void setBounds(Rectangle r) {
if (parent != null) {
Rectangle have = parent.getGraphicsConfiguration().getBounds();
if (r.getX() < have.getWidth() - 25); // may be off screen when switching between 2 monitor system
setBounds(r.x, r.y, r.width, r.height);
}
}
/ *