// Path: demo/swingset3/com/sun/swingset3/demos/DemoUtilities.java
// public class DemoUtilities {
//     private DemoUtilities() {
//         // Hide constructor
//     }
// 
//     public static void setToplevelLocation(Window toplevel, Component component,
//             int relativePosition) {
// 
//         Rectangle compBounds = component.getBounds();
// 
//         // Convert component location to screen coordinates
//         Point p = new Point();
//         SwingUtilities.convertPointToScreen(p, component);
// 
//         int x;
//         int y;
// 
//         // Set frame location to be centered on panel
//         switch (relativePosition) {
//             case SwingConstants.NORTH: {
//                 x = (p.x + (compBounds.width / 2)) - (toplevel.getWidth() / 2);
//                 y = p.y - toplevel.getHeight();
//                 break;
//             }
//             case SwingConstants.EAST: {
//                 x = p.x + compBounds.width;
//                 y = (p.y + (compBounds.height / 2)) - (toplevel.getHeight() / 2);
//                 break;
//             }
//             case SwingConstants.SOUTH: {
//                 x = (p.x + (compBounds.width / 2)) - (toplevel.getWidth() / 2);
//                 y = p.y + compBounds.height;
//                 break;
//             }
//             case SwingConstants.WEST: {
//                 x = p.x - toplevel.getWidth();
//                 y = (p.y + (compBounds.height / 2)) - (toplevel.getHeight() / 2);
//                 break;
//             }
//             case SwingConstants.NORTH_EAST: {
//                 x = p.x + compBounds.width;
//                 y = p.y - toplevel.getHeight();
//                 break;
//             }
//             case SwingConstants.NORTH_WEST: {
//                 x = p.x - toplevel.getWidth();
//                 y = p.y - toplevel.getHeight();
//                 break;
//             }
//             case SwingConstants.SOUTH_EAST: {
//                 x = p.x + compBounds.width;
//                 y = p.y + compBounds.height;
//                 break;
//             }
//             case SwingConstants.SOUTH_WEST: {
//                 x = p.x - toplevel.getWidth();
//                 y = p.y + compBounds.height;
//                 break;
//             }
//             default:
//             case SwingConstants.CENTER: {
//                 x = (p.x + (compBounds.width / 2)) - (toplevel.getWidth() / 2);
//                 y = (p.y + (compBounds.height / 2)) - (toplevel.getHeight() / 2);
//             }
//         }
//         toplevel.setLocation(x, y);
//     }
// 
//     public static boolean browse(URI uri) throws IOException {
//         // Try using the Desktop api first
//         try {
//             Desktop desktop = Desktop.getDesktop();
//             desktop.browse(uri);
// 
//             return true;
//         } catch (SecurityException e) {
//         }
// 
//         return false;
//     }
// }


import com.sun.swingset3.DemoProperties;
import com.sun.swingset3.demos.DemoUtilities;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

        return windowPlaceholder;
    }

    private static JWindow createWindow() {

        //<snip>Create window
        JWindow window = new JWindow();
        //</snip>

        //<snip>Add a border to the window
        window.getRootPane().setBorder(new LineBorder(Color.BLACK, 1));
        //</snip>

        //<snip>Add window's content
        JLabel label = new JLabel("I have no system border.");
        label.setHorizontalAlignment(JLabel.CENTER);
        label.setPreferredSize(new Dimension(250, 200));
        window.add(label);
        //</snip>

        //<snip>Initialize window's size
        // which will shrink-to-fit its contents
        window.pack();
        //</snip>

        return window;
    }

    public void start() {
// Path: demo/swingset3/com/sun/swingset3/demos/DemoUtilities.java
// public class DemoUtilities {
//     private DemoUtilities() {
//         // Hide constructor
//     }
// 
//     public static void setToplevelLocation(Window toplevel, Component component,
//             int relativePosition) {
// 
//         Rectangle compBounds = component.getBounds();
// 
//         // Convert component location to screen coordinates
//         Point p = new Point();
//         SwingUtilities.convertPointToScreen(p, component);
// 
//         int x;
//         int y;
// 
//         // Set frame location to be centered on panel
//         switch (relativePosition) {
//             case SwingConstants.NORTH: {
//                 x = (p.x + (compBounds.width / 2)) - (toplevel.getWidth() / 2);
//                 y = p.y - toplevel.getHeight();
//                 break;
//             }
//             case SwingConstants.EAST: {
//                 x = p.x + compBounds.width;
//                 y = (p.y + (compBounds.height / 2)) - (toplevel.getHeight() / 2);
//                 break;
//             }
//             case SwingConstants.SOUTH: {
//                 x = (p.x + (compBounds.width / 2)) - (toplevel.getWidth() / 2);
//                 y = p.y + compBounds.height;
//                 break;
//             }
//             case SwingConstants.WEST: {
//                 x = p.x - toplevel.getWidth();
//                 y = (p.y + (compBounds.height / 2)) - (toplevel.getHeight() / 2);
//                 break;
//             }
//             case SwingConstants.NORTH_EAST: {
//                 x = p.x + compBounds.width;
//                 y = p.y - toplevel.getHeight();
//                 break;
//             }
//             case SwingConstants.NORTH_WEST: {
//                 x = p.x - toplevel.getWidth();
//                 y = p.y - toplevel.getHeight();
//                 break;
//             }
//             case SwingConstants.SOUTH_EAST: {
//                 x = p.x + compBounds.width;
//                 y = p.y + compBounds.height;
//                 break;
//             }
//             case SwingConstants.SOUTH_WEST: {
//                 x = p.x - toplevel.getWidth();
//                 y = p.y + compBounds.height;
//                 break;
//             }
//             default:
//             case SwingConstants.CENTER: {
//                 x = (p.x + (compBounds.width / 2)) - (toplevel.getWidth() / 2);
//                 y = (p.y + (compBounds.height / 2)) - (toplevel.getHeight() / 2);
//             }
//         }
//         toplevel.setLocation(x, y);
//     }
// 
//     public static boolean browse(URI uri) throws IOException {
//         // Try using the Desktop api first
//         try {
//             Desktop desktop = Desktop.getDesktop();
//             desktop.browse(uri);
// 
//             return true;
//         } catch (SecurityException e) {
//         }
// 
//         return false;
//     }
// }


// Path: demo/swingset3/com/sun/swingset3/demos/window/WindowDemo.java
import com.sun.swingset3.DemoProperties;
import com.sun.swingset3.demos.DemoUtilities;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


        return windowPlaceholder;
    }

    private static JWindow createWindow() {

        //<snip>Create window
        JWindow window = new JWindow();
        //</snip>

        //<snip>Add a border to the window
        window.getRootPane().setBorder(new LineBorder(Color.BLACK, 1));
        //</snip>

        //<snip>Add window's content
        JLabel label = new JLabel("I have no system border.");
        label.setHorizontalAlignment(JLabel.CENTER);
        label.setPreferredSize(new Dimension(250, 200));
        window.add(label);
        //</snip>

        //<snip>Initialize window's size
        // which will shrink-to-fit its contents
        window.pack();
        //</snip>

        return window;
    }

    public void start() {
        DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);