/* * ScreenRes.java - detects user's resolution * Author: Aaron Walker <aaron@iconmedia.com> * ScreenRes is distributed under the GNU General Public License. */import java.applet.Applet;import java.awt.*;public class ScreenRes extends Applet { int height; int width; public void init() { setBackground(Color.white); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); height = d.height; width = d.width; } public void paint(Graphics g) { String str = "Resolution: " + width + " x " + height; Font f = new Font("Helvetica", Font.PLAIN, 12); g.setFont(f); g.drawString(str, 0, 15); }}