All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdc.ui.swing.widgets.HtmlFrame Maven / Gradle / Ivy

There is a newer version: 0.31.1
Show newest version
package cdc.ui.swing.widgets;

import java.awt.Component;
import java.io.File;

import javax.swing.JFrame;

public class HtmlFrame extends JFrame {
    private static final long serialVersionUID = 1L;
    private final HtmlPanel wPanel = new HtmlPanel();

    public HtmlFrame(Component parentComponent) {
        setContentPane(wPanel);
        setLocationRelativeTo(parentComponent);
    }

    public HtmlPanel getHtmlPanel() {
        return wPanel;
    }

    public static void showFrame(Component parentComponent,
                                 String title,
                                 String message,
                                 File... files) {
        final HtmlFrame frame = new HtmlFrame(parentComponent);
        frame.setTitle(title);
        if (message != null) {
            frame.getHtmlPanel()
                 .append(title)
                 .append("

"); } for (final File file : files) { frame.getHtmlPanel() .href(file) .append("
"); } frame.getHtmlPanel() .build(); frame.pack(); frame.setResizable(false); frame.setVisible(true); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy