Java JComponent Size showStaticPage(final URI uri, final Dimension size, final Point location)

Here you can find the source of showStaticPage(final URI uri, final Dimension size, final Point location)

Description

Creates a frame with a JEditorPane with given URI.

License

Open Source License

Declaration

public static void showStaticPage(final URI uri, final Dimension size,
        final Point location) throws IOException 

Method Source Code

//package com.java2s;
import java.awt.BorderLayout;

import java.awt.Dimension;
import java.awt.Point;

import java.io.IOException;
import java.net.URI;

import javax.swing.JEditorPane;
import javax.swing.JFrame;

import javax.swing.JScrollPane;

public class Main {
    /** Creates a frame with a JEditorPane with given URI. */
    public static void showStaticPage(final URI uri, final Dimension size,
            final Point location) throws IOException {
        final JFrame frame = new JFrame();
        frame.getRootPane().setLayout(new BorderLayout());
        JEditorPane editor = new JEditorPane(uri.toString());
        editor.setEditable(false);/*  ww  w  .j a va  2 s. c  om*/
        JScrollPane scrollPane = new JScrollPane(editor);
        frame.getRootPane().add(scrollPane);
        frame.setAlwaysOnTop(true);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        frame.setSize(size);
        frame.setLocation(location);
        frame.setVisible(true);
    }
}

Related

  1. setUnlimitedSize(JComponent component)
  2. setZeroMinimumSize(Component component)
  3. show(final JComponent component, final String windowTitle, final Dimension size)
  4. showComponent(JComponent component, Dimension size)
  5. showGUI(final JComponent newContentPane, final String windowTitle, final Dimension size)
  6. sizeUniformly(JComponent... components)
  7. springSum(int minimumSize, Spring... spr)