2015-09-07 11:44:36 -06:00
|
|
|
|
// com/mindviewinc/util/SwingConsole.java
|
2015-06-15 17:47:35 -07:00
|
|
|
|
// <20>2015 MindView LLC: see Copyright.txt
|
|
|
|
|
// Tool for running Swing demos from the
|
|
|
|
|
// console, both applets and JFrames.
|
|
|
|
|
package com.mindviewinc.util;
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
|
|
public class SwingConsole {
|
|
|
|
|
public static void
|
|
|
|
|
run(final JFrame f, final int width, final int height) {
|
|
|
|
|
SwingUtilities.invokeLater(() -> {
|
|
|
|
|
f.setTitle(f.getClass().getSimpleName());
|
|
|
|
|
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
|
f.setSize(width, height);
|
|
|
|
|
f.setVisible(true);
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
|
}
|