@Override
 public void setWindowShadow(Window window, WindowShadowMode mode) {
   if (window instanceof JWindow) {
     JRootPane root = ((JWindow) window).getRootPane();
     root.putClientProperty(
         "Window.shadow", mode == WindowShadowMode.DISABLED ? Boolean.FALSE : Boolean.TRUE);
     root.putClientProperty("Window.style", mode == WindowShadowMode.SMALL ? "small" : null);
   }
 }
Пример #2
0
 /**
  * Called by the browser or applet viewer to inform this JApplet that it has been loaded into the
  * system. It is always called before the first time that the start method is called.
  */
 public void init() {
   // this is a workaround for a security conflict with some browsers
   // including some versions of Netscape & Internet Explorer which do
   // not allow access to the AWT system event queue which JApplets do
   // on startup to check access. May not be necessary with your browser.
   JRootPane rootPane = this.getRootPane();
   rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
   setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
   b1 = new Button("Choose this card");
   add(b1);
   b1.addActionListener(this);
   // provide any initialisation necessary for your JApplet
 }