diff options
author | Kenneth Russel <[email protected]> | 2008-10-16 01:25:02 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-10-16 01:25:02 +0000 |
commit | e55ba56033cb9193d019cda701673430c919824c (patch) | |
tree | 314b5fa33a555c2b144c65e884b398c9bc11e472 /src/classes/com/sun/javafx/newt/awt/AWTWindow.java | |
parent | ed9fb0e76316689e0df5952a1636240b217ea5f6 (diff) |
Patch from Chris Oliver to enable undecorated frames and setting of
title -- not implemented on all platforms yet
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1773 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/javafx/newt/awt/AWTWindow.java')
-rw-r--r-- | src/classes/com/sun/javafx/newt/awt/AWTWindow.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/classes/com/sun/javafx/newt/awt/AWTWindow.java b/src/classes/com/sun/javafx/newt/awt/AWTWindow.java index 780d7f488..0f5b1df6f 100644 --- a/src/classes/com/sun/javafx/newt/awt/AWTWindow.java +++ b/src/classes/com/sun/javafx/newt/awt/AWTWindow.java @@ -50,7 +50,7 @@ import com.sun.javafx.newt.Window; supporting Java SE. */ public class AWTWindow extends Window { - private Frame frame; + private javax.swing.JFrame frame; private Canvas canvas; private LinkedList/*<AWTEventWrapper>*/ events = new LinkedList(); private boolean gotDisplaySize; @@ -61,18 +61,31 @@ public class AWTWindow extends Window { return false; } + public void setTitle(String title) { + super.setTitle(title); + if (frame != null) { + frame.setTitle(title); + } + } + protected void createNative() { runOnEDT(new Runnable() { public void run() { - frame = new Frame("AWT NewtWindow"); + frame = new javax.swing.JFrame(getTitle()); + frame.setUndecorated(isUndecorated()); + if (isUndecorated()) { + frame.setBackground(new java.awt.Color(0, 0, 0, 0)); + frame.getRootPane().putClientProperty("apple.awt.draggableWindowBackground", Boolean.FALSE); + } frame.setLayout(new BorderLayout()); canvas = new Canvas(); + canvas.setBackground(new java.awt.Color(0, 0, 0, 0)); Listener listener = new Listener(); canvas.addMouseListener(listener); canvas.addMouseMotionListener(listener); canvas.addKeyListener(listener); canvas.addComponentListener(listener); - frame.add(canvas, BorderLayout.CENTER); + frame.getContentPane().add(canvas);//add(canvas, BorderLayout.CENTER); frame.setSize(width, height); frame.setLocation(x, y); frame.addComponentListener(new MoveListener()); |