@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
 }
 private static boolean push(Window owner, Window window) {
   JRootPane root = getRootPane(owner);
   if (root != null) {
     synchronized (CACHE) {
       @SuppressWarnings("unchecked")
       ArrayDeque<Window> cache = (ArrayDeque<Window>) root.getClientProperty(CACHE);
       if (cache == null) {
         cache = new ArrayDeque<Window>();
         root.putClientProperty(CACHE, cache);
       }
       cache.push(window);
       return true;
     }
   }
   return false;
 }
 private static void setWindowShadow(@NotNull Window window, boolean value) {
   JRootPane root = getRootPane(window);
   if (root != null) {
     root.putClientProperty("Window.shadow", value);
   }
 }
예제 #5
0
 public void init() {
   JRootPane rootPane = this.getRootPane();
   rootPane.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
   img = getImage(getDocumentBase(), "ImageDisplay.jpg");
 }