Java Code Examples for com.sun.swingset3.demos.DemoUtilities

The following examples show how to use com.sun.swingset3.demos.DemoUtilities. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: littleluck   Source File: HTMLPanel.java    License: Apache License 2.0 6 votes vote down vote up
public void hyperlinkUpdate(HyperlinkEvent event) {
    JEditorPane descriptionPane = (JEditorPane) event.getSource();
    HyperlinkEvent.EventType type = event.getEventType();
    if (type == HyperlinkEvent.EventType.ACTIVATED) {
        try {
            DemoUtilities.browse(event.getURL().toURI());
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println(e);
        }

    } else if (type == HyperlinkEvent.EventType.ENTERED) {
        defaultCursor = descriptionPane.getCursor();
        descriptionPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    } else if (type == HyperlinkEvent.EventType.EXITED) {
        descriptionPane.setCursor(defaultCursor);
    }
}
 
Example 2
Source Project: beautyeye   Source File: HTMLPanel.java    License: Apache License 2.0 6 votes vote down vote up
public void hyperlinkUpdate(HyperlinkEvent event) {
    JEditorPane descriptionPane = (JEditorPane) event.getSource();
    HyperlinkEvent.EventType type = event.getEventType();
    if (type == HyperlinkEvent.EventType.ACTIVATED) {
        try {
            DemoUtilities.browse(event.getURL().toURI());
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println(e);
        }

    } else if (type == HyperlinkEvent.EventType.ENTERED) {
        defaultCursor = descriptionPane.getCursor();
        descriptionPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    } else if (type == HyperlinkEvent.EventType.EXITED) {
        descriptionPane.setCursor(defaultCursor);
    }
}
 
Example 3
Source Project: Darcula   Source File: HTMLPanel.java    License: Apache License 2.0 6 votes vote down vote up
public void hyperlinkUpdate(HyperlinkEvent event) {
    JEditorPane descriptionPane = (JEditorPane) event.getSource();
    HyperlinkEvent.EventType type = event.getEventType();
    if (type == HyperlinkEvent.EventType.ACTIVATED) {
        try {
            DemoUtilities.browse(event.getURL().toURI());
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println(e);
        }

    } else if (type == HyperlinkEvent.EventType.ENTERED) {
        defaultCursor = descriptionPane.getCursor();
        descriptionPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    } else if (type == HyperlinkEvent.EventType.EXITED) {
        descriptionPane.setCursor(defaultCursor);
    }
}
 
Example 4
Source Project: openjdk-jdk9   Source File: DialogDemo.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
    showDialog();
}
 
Example 5
Source Project: openjdk-jdk9   Source File: WindowDemo.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);
    showWindow();
}
 
Example 6
Source Project: littleluck   Source File: DialogDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
    showDialog();
}
 
Example 7
Source Project: littleluck   Source File: WindowDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);
    showWindow();
}
 
Example 8
Source Project: littleluck   Source File: FrameDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(frame, frameSpaceholder, SwingConstants.CENTER);
    showFrame();
}
 
Example 9
Source Project: beautyeye   Source File: DialogDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
    showDialog();
}
 
Example 10
Source Project: beautyeye   Source File: WindowDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);
    showWindow();
}
 
Example 11
Source Project: beautyeye   Source File: FrameDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(frame, frameSpaceholder, SwingConstants.CENTER);
    showFrame();
}
 
Example 12
Source Project: Darcula   Source File: DialogDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
    showDialog();
}
 
Example 13
Source Project: Darcula   Source File: WindowDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);
    showWindow();
}
 
Example 14
Source Project: Darcula   Source File: FrameDemo.java    License: Apache License 2.0 4 votes vote down vote up
public void start() {
    DemoUtilities.setToplevelLocation(frame, frameSpaceholder, SwingConstants.CENTER);
    showFrame();
}