import com.ms.security.*; import java.awt.*; public class HelloWinColor extends java.applet.Applet { public void init() { String buttonText = "Launch Win32 Color Dialog"; Button playbut = new Button(buttonText) ; add(new Button(buttonText)); } public boolean action(java.awt.Event e, Object arg) { if ( e.target instanceof Button ) { PolicyEngine.assertPermission(PermissionID.SYSTEM); Win32ColorDlg dlg = new Win32ColorDlg(); int c = dlg.getColor(); System.out.println("r,g,b = " + (c & 0xFF) + "," + ((c >> 8) & 0xFF) + "," + ((c >> 16) & 0xFF)); for (int i = 0; i < Win32ColorDlg.NUM_CUST_COLORS; i++) System.out.println("custom[" + i + "] = " + (dlg.cust[i] & 0xFF) + "," + ((dlg.cust[i] >> 8) & 0xFF) + "," + ((dlg.cust[i] >> 16) & 0xFF)); return true ; } return true; } }