git://git.nikiroo.be
/
nikiroo-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
99144c7
)
switch to JFrame to support webswing
author
Kevin Lamonte
<kevin.lamonte@gmail.com>
Wed, 18 Mar 2015 02:13:38 +0000
(22:13 -0400)
committer
Kevin Lamonte
<kevin.lamonte@gmail.com>
Wed, 18 Mar 2015 02:13:38 +0000
(22:13 -0400)
src/jexer/io/AWTScreen.java
patch
|
blob
|
blame
|
history
diff --git
a/src/jexer/io/AWTScreen.java
b/src/jexer/io/AWTScreen.java
index f56f4238c765353ec325c5cbf080ed4558a3cb89..a3fc41f19fa03563ca292c5f4feed4e28fd0c33f 100644
(file)
--- a/
src/jexer/io/AWTScreen.java
+++ b/
src/jexer/io/AWTScreen.java
@@
-47,6
+47,8
@@
import java.awt.Toolkit;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.InputStream;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
/**
* This Screen implementation draws to a Java AWT Frame.
/**
* This Screen implementation draws to a Java AWT Frame.
@@
-103,7
+105,7
@@
public final class AWTScreen extends Screen {
/**
* AWTFrame is our top-level hook into the AWT system.
*/
/**
* AWTFrame is our top-level hook into the AWT system.
*/
- class AWTFrame extends Frame {
+ class AWTFrame extends
J
Frame {
/**
* The terminus font resource filename.
/**
* The terminus font resource filename.
@@
-236,7
+238,7
@@
public final class AWTScreen extends Screen {
setDOSColors();
setTitle("Jexer Application");
setDOSColors();
setTitle("Jexer Application");
- setBackground(
java.awt.
Color.black);
+ setBackground(Color.black);
// setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
// setFont(new Font("Liberation Mono", Font.BOLD, 16));
// setFont(new Font(Font.MONOSPACED, Font.PLAIN, 16));
// setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
// setFont(new Font("Liberation Mono", Font.BOLD, 16));
// setFont(new Font(Font.MONOSPACED, Font.PLAIN, 16));
@@
-253,6
+255,7
@@
public final class AWTScreen extends Screen {
// setFont(new Font("Liberation Mono", Font.PLAIN, 24));
setFont(new Font(Font.MONOSPACED, Font.PLAIN, 24));
}
// setFont(new Font("Liberation Mono", Font.PLAIN, 24));
setFont(new Font(Font.MONOSPACED, Font.PLAIN, 24));
}
+ pack();
setVisible(true);
resizeToScreen();
setVisible(true);
resizeToScreen();
@@
-417,7
+420,15
@@
public final class AWTScreen extends Screen {
* Public constructor.
*/
public AWTScreen() {
* Public constructor.
*/
public AWTScreen() {
- frame = new AWTFrame(this);
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ AWTScreen.this.frame = new AWTFrame(AWTScreen.this);
+ }
+ } );
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
/**
}
/**