2015-04-20 15:36:01 -07:00
|
|
|
//: net/mindview/util/SwingConsole.java
|
|
|
|
// Tool for running Swing demos from the
|
|
|
|
// console, both applets and JFrames.
|
|
|
|
package net.mindview.util;
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
public class SwingConsole {
|
|
|
|
public static void
|
|
|
|
run(final JFrame f, final int width, final int height) {
|
2015-05-05 14:05:39 -07:00
|
|
|
SwingUtilities.invokeLater(() -> {
|
|
|
|
f.setTitle(f.getClass().getSimpleName());
|
|
|
|
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
f.setSize(width, height);
|
|
|
|
f.setVisible(true);
|
2015-04-20 15:36:01 -07:00
|
|
|
});
|
|
|
|
}
|
|
|
|
} ///:~
|