The applet below displays a web page with 640x480 resolution.

Java Code:
public class whatres extends Applet {
  public void init() {
    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    if (dim.width==640 && dim.height==480) {
       try {
         getAppletContext().showDocument
           (new URL(getCodeBase()+"lowres.html"),"_top");
       }
       catch (Exception ex) {}
    }
    else {
       try {
         getAppletContext().showDocument
           (new URL(getCodeBase()+"hires.html"),"_top");
       }
       catch (Exception ex) {}
    }
  }
}