Java 3D and fullscreen exclusive mode

Hello all. I have the following problem: if I try to set fullscreen exclusive mode by calling
device.setFullScreenWindow(window);
then Java renders nothing. If I remove this line of code, everything works perfectly. Any ideas?
Thanks in advance!

you can't do that like that! it's a bit more conplicated. if you haven't,take a look at that:
http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html

Similar Messages

  • Event Handling in Fullscreen Exclusive Mode???????

    WIndows XP SP2
    ATI 8500 All-In-Wonder
    JDK 1.6
    800x600 32dpi 200 refresh
    1-6 buffer strategy.
    the graphic rendering thread DOESN'T sleep.
    Here's my problem. I have a bad trade off. In fullscreen exclusive mode my animation runs <30 fps and jerks when rendering. i.e. stop and go movement (not flickering/jittering just hesitant motion) when the animation is running. I solved this problem by raising the thread priority of the rendering (7-8). . . this resulted in latency/no activity for my input events both key and mouse. For instance closing the program alt-f4 will arbitrarily fail or be successful when the thread priority is raised above 6.
    How does one accomplish a >30 fps and Instant event handling simultaneously in Fullscreen Exclusive Mode?
    Is there a way to raise thread priority for event handling?
    Ultimately I want to be able to perform my animations and handle key and mouse input events without having a visible 'hiccups' on the screen.
    Much Appreciated!

    If I remember correctly the processor is a 1.4(or)6ghz AMD Duron
    Total = 1048048kb
    Available = 106084kb
    Sys Cache = 211788kb
    PF Usage = 1.01 GB
    I solved some of the problem after posting this thread. . . .
    I inserted a thread.sleep(1) and my alt-f4 operation worked unhindered with the elevated thread priority.
    I haven't tested it with mouse event or any other key event but at the moment it looks I may have solved the problem.
    If so, my next question will be is there a way to reduce the amount of cpu power needed to run the program.
    I'm afraid that the other classes that I'm adding will actually become even more process consuming than the actually rendering thread.
    public class RenderScreen extends Thread
      // Screen Rendering status code
      protected final static int RUNNING = 0,
                                 PAUSED = -1;
      // frames per second and process time counters
      protected long now = 0, fps = 0, fpsCount = 0, cycTime = 0;
      // thread status
      protected int status = 0;
      protected Screen screen;
      public void setStatus(int i){ status = i; };
      public void setTarget(Screen screen){ this.screen=screen; };
      public void run()
        setName("Screen Render");
        screen.createBufferStrategy(1);
        screen.strategy = screen.getBufferStrategy();
        for(;;)
          if(status == RUNNING)
            now = System.currentTimeMillis();
            while(System.currentTimeMillis() <= now+1000)
              // call system processes
              // fps increment / repaint interface
              fpsCount++;
              screen.renderView();
              try { Thread.sleep(1);}catch(InterruptedException ie){ ie.printStackTrace(); }
            fps = fpsCount;
            cycTime = System.currentTimeMillis() - (now + 1000);
            fpsCount=0;
      public RenderScreen(){};
      public RenderScreen(Screen screen){ this.screen=screen; };
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class Screen extends Window
      BufferedImage image = new BufferedImage(800,600,BufferedImage.TYPE_INT_RGB);
      Graphics2D gdd = image.createGraphics();
      MediaTracker tracker = new MediaTracker(this);
      Image bground = getToolkit().getImage("MajorityRule.jpg"),
            bawl = getToolkit().getImage("bawl.gif");
      RenderScreen rScreen = new RenderScreen(this);
      BufferStrategy strategy;
      Graphics g;
      Rectangle rect = new Rectangle(400,0,150,150);
      //Game game = new Game();
      public void renderView()
        g = strategy.getDrawGraphics();
        //--------- Game Procedures [start]
        gdd.drawImage(bground,0,0,this);
        gdd.drawString("fps: ["+rScreen.fps+"] Cycle Time: ["+rScreen.cycTime+"]",0,10);
        //--------- Game Procedures [end]
        //---------test
        gdd.drawImage(bawl,rect.x,rect.y,rect.width,rect.height,this);
        rect.translate(0,1);
        g.drawImage(image,0,0,this);
        //g.dispose();
        strategy.show();
      public Screen(JFrame frame)
        super(frame);
        try
          tracker.addImage(bground,0);
          tracker.addImage(bawl,1);
          tracker.waitForAll();
        catch(InterruptedException ie){ ie.printStackTrace(); }
        setBackground(Color.black);
        setForeground(Color.white);
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MajorityRule extends JFrame
      // Graphic System Handlers
      GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      GraphicsDevice gd = ge.getDefaultScreenDevice();
      GraphicsConfiguration gc = gd.getDefaultConfiguration();
      Screen screen = new Screen(this);
      Paper paper = new Paper();
      public void windowed()
        paper.setSize(getWidth(),getHeight());
        getContentPane().add(paper);
        setResizable(false);
        setVisible(true);
      public void fullscreen()
        DisplayMode dMode = new DisplayMode(800,600,32,200);
        screen.setBounds(0,0,800,600);
        if (gd.isFullScreenSupported()) gd.setFullScreenWindow(screen);
        if (gd.isDisplayChangeSupported()){ gd.setDisplayMode(dMode); };
        screen.setIgnoreRepaint(true);
        screen.setVisible(true);
        screen.rScreen.setPriority(Thread.MAX_PRIORITY);
        screen.rScreen.start();
        screen.requestFocus();
      public MajorityRule(String args[])
        setTitle("Majority Rule [Testing Block]");
        setBounds(0,0,410,360);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        getContentPane().setLayout(null);
        if (args.length > 0 && args[0].equals("-window")) windowed();
        else fullscreen();
      public static void main(String args[])
        new MajorityRule(args);
    };

  • Swing Components and Fullscreen Exclusive

    Hi, I am trying to write a program that can switch between full screen and windowed mode seamlessly, while still being able to use standard swing components. I have never worked with the full screen exclusive mode before and am having trouble getting the components to repaint properly.
    The following code works fine in the windowed and undecorated modes, however when I switch to fullscreen exclusive mode all components disappear and only repaint upon mouseover or other interaction. Calls to repaint do not make any difference.
    import java.awt.Dimension;
    import java.awt.DisplayMode;
    import java.awt.FlowLayout;
    import java.awt.GraphicsDevice;
    import java.awt.GraphicsEnvironment;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.WindowConstants;
    public class FullscreenTests {
         private static boolean hwlast = false;
         private static GraphicsDevice dev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
         public static void main(String[] args) {
              final JFrame fMain = new JFrame("Title");
              fMain.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              fMain.getRootPane().setLayout(new FlowLayout());
              JButton win = new JButton("Windowed");
              win.addActionListener(new ActionListener () {
                   public void actionPerformed (ActionEvent e) {
                        setWindowed(fMain);
              fMain.getRootPane().add(win);
              JButton ful = new JButton("Fullscreen");
              ful.addActionListener(new ActionListener () {
                   public void actionPerformed (ActionEvent e) {
                        setFullscreen(fMain);
              fMain.getRootPane().add(ful);
              JButton hw = new JButton("HW Fullscreen");
              hw.addActionListener(new ActionListener () {
                   public void actionPerformed (ActionEvent e) {
                        setHWFullscreen(fMain);
              fMain.getRootPane().add(hw);
              setWindowed(fMain);
         public static void setWindowed(JFrame f) {
              if (hwlast == true) {
                   dev.setFullScreenWindow(null);
                   hwlast = false;
              f.dispose();
              f.setIgnoreRepaint(false);
              f.setUndecorated(false);
              Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
              f.setSize(new Dimension(808,634));
              f.setMinimumSize(new Dimension(808,634));
              f.setLocation((d.width-f.getWidth())/2, (d.height-f.getHeight())/2);
              f.setVisible(true);
         public static void setHWFullscreen(JFrame f) {
              hwlast = true;
              f.dispose();
              f.setUndecorated(true);
              f.setIgnoreRepaint(true);
              f.setVisible(true);
              dev.setFullScreenWindow(f);
              dev.setDisplayMode(new DisplayMode(800, 600, 32, DisplayMode.REFRESH_RATE_UNKNOWN));
         public static void setFullscreen(JFrame f) {
              if (hwlast == true) {
                   dev.setFullScreenWindow(null);
                   hwlast = false;
              f.dispose();
              f.setIgnoreRepaint(false);
              f.setUndecorated(true);
              f.setSize(Toolkit.getDefaultToolkit().getScreenSize());
              f.setLocation(0,0);
              f.setVisible(true);
    }On the same note, if there are better ways of doing this I would be glad to know. This is just a quick test so I haven't done any checks etc when switching to fullscreen exclusive.

       public static void setHWFullscreen (JFrame f) {
          hwlast = true;
          f.dispose ();
          f.setUndecorated (true);
          f.setIgnoreRepaint (true);
          // add this
          Graphics g = f.getGraphics ();
          f.paintAll (g);
          f.setVisible (true);
          dev.setFullScreenWindow (f);
          dev.setDisplayMode (new DisplayMode (800, 600, 32, DisplayMode.REFRESH_RATE_UNKNOWN));
       }db

  • JMF In Fullscreen Exclusive Mode

    Hello,
    I was wondering if anyone could let me know if JMF is supported inside a Fullscreen Exclusive Application? I seem to have no problem setting up JMF Video output for a standard JFrame/Frame, but when setting a "fullscreenWindow" the Player turns black. I cannot seem to find any posts on whether this is supported or if there are bugs when in Fullscreen Exclusive Mode.
    Thanks
    -Michael Morris

    Never written a fullscreen exclusive application. In fact, I've never even heard of such a thing.
    http://download.oracle.com/javase/tutorial/extra/fullscreen/exclusivemode.html
    "In full-screen exclusive applications, painting is usually done actively by the program itself"
    Ah. So no, I don't think JMF would support that because it's not going to be actively rendering, only passively rendering in response to paint requests. It's AWT/Swing based, after all...
    But, the fact that JMF doesn't support it does not mean JMF can't support it. JMF provides a custom Renderer interface which you could implement to actively render the stuff. It'll essentially give you a copy of the video frame in a Buffer object which you can then turn into an image using the BufferToImage class and then render that however you'd render an image for a full screen exclusive application...

  • How to get out of fullscreen exclusive mode?

    I have a program that runs in full screen exclusive mode, I'd like the program to start up in windowed mode instead.
    I spent several hours trying to make it run in window mode, but I can't seem to figure it out :/
    Here's the code:
            if (graphicsDevice.isFullScreenSupported()) {
                graphicsDevice.setFullScreenWindow(this);
            if (graphicsDevice.isDisplayChangeSupported() == false) {
                return false;
            boolean displayModeAvailable = false;
            DisplayMode[] displayModes = graphicsDevice.getDisplayModes();
            for (DisplayMode mode : displayModes) {
                if (screenWidth == mode.getWidth() && screenHeight == mode.getHeight()
                        && screenColorDepth == mode.getBitDepth()) {
                    displayModeAvailable = true;
            if (displayModeAvailable == false) {
                return false;
            DisplayMode targetDisplayMode =
                    new DisplayMode(screenWidth, screenHeight,
                        screenColorDepth, DisplayMode.REFRESH_RATE_UNKNOWN);
            try {
                graphicsDevice.setDisplayMode(targetDisplayMode);
            } catch (IllegalArgumentException exception) {
                return false;
            if (EventQueue.isDispatchThread() == false) {
                EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        createBufferStrategy(2);
            } else {
                createBufferStrategy(2);
            bufferStrategy = getBufferStrategy();
            try {
                graphics2D = (Graphics2D) bufferStrategy.getDrawGraphics();
                gameRender(graphics2D);
                if (drawGameStatistics) {
                    gameStatisticsRecorder.drawStatistics(graphics2D, 0, 0);
                graphics2D.dispose();
            } catch (Exception exception) {
                System.err.println("GameEngine.gameRender: " +
                        "Error cannot render screen:" + exception.toString());
                exception.printStackTrace();
            }Thanks

    Have you read these?
    [http://java.sun.com/docs/books/tutorial/extra/fullscreen/]
    [http://java.sun.com/docs/books/tutorial/extra/fullscreen/exclusivemode.html]
    db

  • Fullscreen Exclusive Mode

    Hi
    I am currently playing around with the new fullscreen api that is included with SDK1.4. But I have a problem. I would like to have images and Swing components showing at the same time and controling when to paint this. I am working with the code from the tutorial http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html . So far I can display the image but no Swing component. Can someone help me?
    * This test takes a number up to 13 as an argument (assumes 2 by
    * default) and creates a multiple buffer strategy with the number of
    * buffers given.  This application enters full-screen mode, if available,
    * and flips back and forth between each buffer (each signified by a different
    * color).
    import java.awt.*;
    import java.awt.image.BufferStrategy;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.*;
    public class MultiBufferTest {
        private static DisplayMode[] BEST_DISPLAY_MODES = new DisplayMode[] {
            new DisplayMode(800, 600, 32, 0),
        Frame mainFrame;
        boolean remove = false;
        public MultiBufferTest(int numBuffers, GraphicsDevice device) {
            try {
                Image image = (new LoadImage("mypic.jpg")).getImage();
                GraphicsConfiguration gc = device.getDefaultConfiguration();
                mainFrame = new Frame(gc);
                mainFrame.setUndecorated(true);
                mainFrame.setIgnoreRepaint(true);
                device.setFullScreenWindow(mainFrame);
                if (device.isDisplayChangeSupported()) {
                    chooseBestDisplayMode(device);
                Rectangle bounds = mainFrame.getBounds();
                mainFrame.createBufferStrategy(2);
                mainFrame.addMouseMotionListener(new MA());
                mainFrame.addMouseListener(new MA());
                JLabel label = new JLabel("hi");
                label.setLocation(new Point(200, 200));
                label.setForeground(new Color(122,23,52));
                mainFrame.add(label);
                BufferStrategy bufferStrategy = mainFrame.getBufferStrategy();
                int x, y;
                x=0;
                y=0;
                boolean done = false;
                while (!done){
                   Graphics g = bufferStrategy.getDrawGraphics();
                   if (!bufferStrategy.contentsLost()) {
                      g.setColor(Color.black);
                      g.fillRect(0,0,bounds.width, bounds.height);
                      mainFrame.paintComponents(g);
                      if (!remove)
                         g.drawImage(image, x, y, 60, 60, mainFrame);
                      bufferStrategy.show();
                      g.dispose();
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                device.setFullScreenWindow(null);
        public void removeImage(){
           remove = true;
        private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
            for (int x = 0; x < BEST_DISPLAY_MODES.length; x++) {
                DisplayMode[] modes = device.getDisplayModes();
                for (int i = 0; i < modes.length; i++) {
                    if (modes.getWidth() == BEST_DISPLAY_MODES[x].getWidth()
    && modes[i].getHeight() == BEST_DISPLAY_MODES[x].getHeight()
    && modes[i].getBitDepth() == BEST_DISPLAY_MODES[x].getBitDepth()
    return BEST_DISPLAY_MODES[x];
    return null;
    public static void chooseBestDisplayMode(GraphicsDevice device) {
    DisplayMode best = getBestDisplayMode(device);
    if (best != null) {
    device.setDisplayMode(best);
    public static void main(String[] args) {
    try {
    int numBuffers = 2;
    if (args != null && args.length > 0) {
    numBuffers = Integer.parseInt(args[0]);
    if (numBuffers < 2 || numBuffers > COLORS.length) {
    System.err.println("Must specify between 2 and "
    + COLORS.length + " buffers");
    System.exit(1);
    GraphicsEnvironment env = GraphicsEnvironment.
    getLocalGraphicsEnvironment();
    GraphicsDevice device = env.getDefaultScreenDevice();
    MultiBufferTest test = new MultiBufferTest(numBuffers, device);
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);
    public class MA extends MouseInputAdapter{
              public void mouseClicked(MouseEvent e){
              public void mouseEntered(MouseEvent e){
              public void mouseExited(MouseEvent e){
              public void mousePressed(MouseEvent e){
    if (e.getX() < 60 && e.getY() < 60)
    removeImage();
              public void mouseReleased(MouseEvent e){
              public void mouseMoved(MouseEvent e) {
              public void mouseDragged(MouseEvent e) {
    //CLASS LOADIMAGE.JAVA
    import java.awt.*;
    class LoadImage extends Component{
    Image image;
    public LoadImage( String path ){
    Toolkit toolkit = getToolkit();
    MediaTracker tracker = new MediaTracker(this);
    image = toolkit.getImage(path);
    tracker.addImage(image,0);
    try {
    tracker.waitForID(0);
    catch(InterruptedException e){
    System.out.println("fel vid inl�sning av bilder");
    public Image getImage(){
    return image;

    If anyone is interested here is a code that solves the problem.
    * This test takes a number up to 13 as an argument (assumes 2 by
    * default) and creates a multiple buffer strategy with the number of
    * buffers given.  This application enters full-screen mode, if available,
    * and flips back and forth between each buffer (each signified by a different
    * color).
    import java.awt.*;
    import java.awt.image.BufferStrategy;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.*;
    public class MultiBufferTest {
        int x, y;
        private static DisplayMode[] BEST_DISPLAY_MODES = new DisplayMode[] {
            new DisplayMode(800, 600, 32, 0),
            new DisplayMode(800, 600, 16, 0),
        Frame mainFrame;
        boolean remove = false;
        public MultiBufferTest(int numBuffers, GraphicsDevice device) {
            try {
                Image image = (new LoadImage("backmask.jpg")).getImage();
                GraphicsConfiguration gc = device.getDefaultConfiguration();
                mainFrame = new Frame(gc);
                mainFrame.setUndecorated(true);
                mainFrame.setIgnoreRepaint(true);
                device.setFullScreenWindow(mainFrame);
                if (device.isDisplayChangeSupported())
                    chooseBestDisplayMode(device);
                Rectangle bounds = mainFrame.getBounds();
                mainFrame.createBufferStrategy(2);
                mainFrame.addMouseMotionListener(new MA());
                mainFrame.addMouseListener(new MA());
                JButton button = new JButton("ASDFJKSADFKASDFJK");
                button.setBounds(200, 200, 200, 200);
                mainFrame.add(button);
                BufferStrategy bufferStrategy = mainFrame.getBufferStrategy();
                x=0;
                y=0;
                boolean done = false;
                while (!done){
                   Graphics g = bufferStrategy.getDrawGraphics();
                   if (!bufferStrategy.contentsLost()) {
                      g.setColor(Color.black);
                      g.fillRect(0,0,bounds.width, bounds.height);
                      g.drawImage(image, x, y, 60, 60, mainFrame);
                      mainFrame.paint(g);
                      bufferStrategy.show();
                      g.dispose();                
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                device.setFullScreenWindow(null);
        public void removeImage(){
           remove = true;
        private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
            for (int x = 0; x < BEST_DISPLAY_MODES.length; x++) {
                DisplayMode[] modes = device.getDisplayModes();
                for (int i = 0; i < modes.length; i++) {
                    if (modes.getWidth() == BEST_DISPLAY_MODES[x].getWidth()
    && modes[i].getHeight() == BEST_DISPLAY_MODES[x].getHeight()
    && modes[i].getBitDepth() == BEST_DISPLAY_MODES[x].getBitDepth()
    return BEST_DISPLAY_MODES[x];
    return null;
    public static void chooseBestDisplayMode(GraphicsDevice device) {
    DisplayMode best = getBestDisplayMode(device);
    if (best != null) {
    device.setDisplayMode(best);
    public static void main(String[] args) {
    try {
    GraphicsEnvironment env = GraphicsEnvironment.
    getLocalGraphicsEnvironment();
    GraphicsDevice device = env.getDefaultScreenDevice();
    MultiBufferTest test = new MultiBufferTest(2, device);
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);
    public class MA extends MouseInputAdapter{
              public void mouseClicked(MouseEvent e){
    x = e.getX();
    y = e.getY();
              public void mouseEntered(MouseEvent e){
              public void mouseExited(MouseEvent e){
              public void mousePressed(MouseEvent e){
    x = e.getX();
    y = e.getY();
              public void mouseReleased(MouseEvent e){
    x = e.getX();
    y = e.getY();
              public void mouseMoved(MouseEvent e) {
    x = e.getX();
    y = e.getY();
              public void mouseDragged(MouseEvent e) {
    x = e.getX();
    y = e.getY();

  • Exiting programs that have use the fullscreen exclusive mode

    I have lots of problems, this is one of them:
    When making a program that uses fullscreen mode, the program does not exit by itself when it comes to the end of the program. In fact the only way I can get it to exit is through System.exit(0);
    And I don't want to use that for numerous reasons.
    try
    gd.setFullScreenWindow(jw);
    gd.setDisplayMode(dm[theDisplayMode]);
    finally
    gd.setDisplayMode(oldDisplayMode);
    gd.setFullScreenWindow(null);
    end of program......
              }

    I have lots of problems, this is one of them:
    When making a program that uses fullscreen mode, the program does not exit by itself when it comes to the end of the program. In fact the only way I can get it to exit is through System.exit(0);
    And I don't want to use that for numerous reasons.
    try
    gd.setFullScreenWindow(jw);
    gd.setDisplayMode(dm[theDisplayMode]);
    finally
    gd.setDisplayMode(oldDisplayMode);
    gd.setFullScreenWindow(null);
    end of program......
              }

  • Is it possible to use fullscreen and exclusive mode with a jfilechooser?

    is there a way to use them together? while in fullscreen exclusive mode the jfilechooser doesn't attach to fullscreen window and it halts the program.. I've tried setting the parent frame as the fullscreen frame but it's all glitched.. am I missing something?
    thank you,
    best regards,
    Jacopo

    For reference, the cross-post can be found here:
    Is it possible to use network devices (cDAQ-9188) with a PXI Real Time system?
    Jayme W.
    Applications Engineer
    National Instruments

  • Applet, Frame and fullscreen

    Hi!
    Have an application wich is a Applet and also can run as a desktop program. The fullscreen desktop function some time ago sotpped work, now I have been testing to discover the problem and discovered the Applet does not work correctly when inside my Frame, the Panel class also does not work, only the JPanel is drawed in my fullscreen.
    So, I want to ask why the Applet does not work anymore when the Frame is in fullscreen exclusive mode?... and what is the best practice in this case, because I want my game to run in desktop and inside web browser?
    Thanks in advance

    Janio wrote:
    Ok, the browser window wrapper does nothing in particular, in fact it can be replaced by a Frame using java web start, but maybe the users will get intimidated by this approach.And maybe they won't. Developers seem to have a greater fear of apps. launched using JWS than users do.
    Note that an app. launched using JWS will work for more users than an applet. There are constant browser/JRE interaction bugs discovered, that trip up applet deployment.
    I just want an alternative for this problem with Applets inside frames.Applets can be dropped into a frames, but it requires some extra hassles. If you control the code, I would not recommend going that way.
    (And now I re-read this thread from the top..)
    I am confused by what you mean by 'full-screen' in combination with 'applet'. An applet embedded in a web page has its size set in HTML. If you want something to be full-screen, it would require the applet launching a free-floating (J)Frame, (J)Window or (J)Dialog (etc.). Is that what it does?

  • Java 3D in fullscreen.  How?

    I need to display animated 3D images in fullscreen exclusive mode and I'm using active rendering as opposed to passive. How can I display parts of the virtual universe in fullscreen mode with active rendering? Many, many thanks to whoever can help me out with this.

    import java.awt.*;
    public class FullScreenMode {
        private static DisplayMode[] BEST_DISPLAY_MODES = new DisplayMode[] {
            new DisplayMode(640, 480, 32, 0),
            new DisplayMode(640, 480, 16, 0),
            new DisplayMode(640, 480, 8, 0)
        Frame mainFrame;
        public FullScreenMode(GraphicsDevice device) {
            try {
                GraphicsConfiguration gc = device.getDefaultConfiguration();
                mainFrame = new Frame(gc);
                mainFrame.setUndecorated(true);
                mainFrame.setIgnoreRepaint(true);
                device.setFullScreenWindow(mainFrame);
                if (device.isDisplayChangeSupported()) {
                    chooseBestDisplayMode(device);
                mainFrame.getGraphics().drawString("I'm in Full Screen MODE",50,50);
                Thread.sleep(3000);
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                device.setFullScreenWindow(null);
        private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
            for (int x = 0; x < BEST_DISPLAY_MODES.length; x++) {
                DisplayMode[] modes = device.getDisplayModes();
                for (int i = 0; i < modes.length; i++) {
                    if (modes.getWidth() == BEST_DISPLAY_MODES[x].getWidth()
    && modes[i].getHeight() == BEST_DISPLAY_MODES[x].getHeight()
    && modes[i].getBitDepth() == BEST_DISPLAY_MODES[x].getBitDepth()
    return BEST_DISPLAY_MODES[x];
    return null;
    public static void chooseBestDisplayMode(GraphicsDevice device) {
    DisplayMode best = getBestDisplayMode(device);
    if (best != null) {
    device.setDisplayMode(best);
    public static void main(String[] args) {
    try {
    GraphicsEnvironment env = GraphicsEnvironment.
    getLocalGraphicsEnvironment();
    GraphicsDevice device = env.getDefaultScreenDevice();
              FullScreenMode fsm = new FullScreenMode(device);
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);

  • JMF video while in Fullscreen Exclusive

    I am trying to show a video (using JMF) in my window while in fullscreen exclusive mode. Its for a game. It works occasionally. What I've done is turned of the repetitive rendering (from the game loop), and just added the visual component to the window (it can do its own painting). Sometimes it works fine, other times you just hear the sound, and other times its just grey or black.
    Does anybody have any idea how to get the current frame, and draw it so that I can keep the repetitive rendering (from the game loop) running.
    Any other ideas are appreciated too.

    Never written a fullscreen exclusive application. In fact, I've never even heard of such a thing.
    http://download.oracle.com/javase/tutorial/extra/fullscreen/exclusivemode.html
    "In full-screen exclusive applications, painting is usually done actively by the program itself"
    Ah. So no, I don't think JMF would support that because it's not going to be actively rendering, only passively rendering in response to paint requests. It's AWT/Swing based, after all...
    But, the fact that JMF doesn't support it does not mean JMF can't support it. JMF provides a custom Renderer interface which you could implement to actively render the stuff. It'll essentially give you a copy of the video frame in a Buffer object which you can then turn into an image using the BufferToImage class and then render that however you'd render an image for a full screen exclusive application...

  • AWT Popup Menu in Fullscreen Exclusive + JOGL

    Our application runs in Fullscreen Exclusive mode and uses JOGL. We want the user to be able to access right-click Popup menus like in other applications. (Obviously, this isn't a game; but I figured I'd post here because game developers are the only ones likely to be familiar with Fullscreen Exclusive.)
    On Windows, I was pleasantly suprised to find that popupMenu.show() just works when I'm in Fullscreen Exclusive. The menu appears, works correctly, etc.
    On Mac OS X 10.3+, the menu does not appear. I've developed a clumsy workaround (basically, go out of fullscreen exclusive to show the menu, and then go back in when mouse events start coming again). Frankly, the way it works on a Mac is what I expected on the PC. I wouldn't expect a Popup Menu (being another window) to be able to appear over a fullscreen exclusive window.
    My question is this: Is the Windows behavior a bug? Is it video driver dependent? (It seems to work OK with all the machines we've tested on... ATI, NVIDIA, Intel) Should I be doing my Mac hack on the Windows platform to avoid some unforseen problem?
    Also, any idea what Linux or other platforms would do?

    I am not sure why that works in one OS and not the others.
    All I can say is that if it was a game, we would draw the popup menu ourself within the frame in our rendering loop, that is garunteed to work in all OS's. But your probably using AWT or SWING components. Sounds like it may be a compadibility issue, I would check the bug lists to see if that is a known issue that is being worked on.

  • Popups in fullscreen exclusive?

    My game is running in fullscreen exclusive mode but I need to open the occasional dialog box which new shows in front of the fullscreen main frame. Is there any way of making popups such as Dialogs or other frames appear in fullscreen exclusive mode?

    Since when did any game you ever played written in even the most powerful languages and 2d/3d api's ever display a popup during the programs run in fullscreen exclusive mode? (Error popup dialogs that end the game dont count. Unless you 'wanted' your app to end after a popup of course... o_O)
    Now, as for a more efficient/robust/intuitive/cooler etc way to display important information to the user, perhaps your game (I'm assuming its a game due to where this is posted) should draw its own frame lookalike that could function just like a popup, only it resided in the game, and had its own look and feel. ( a look that should undoubtly be way more apealing to your audience than a standard dialog...)

  • Any chance of Flash using WASAPI Exclusive Mode?

    My new Win7 computer is connected to my home audio system via a "bit perfect" optical output feeding a "professional audio" DAC. Players that can bypass Direct Sound and the Windows Mixer, and take Exclusive Mode control of the WASAPI channel, sound noticeably better. If I go to the trouble of capturing a Flash file and playing it locally through WASAPI, it sounds much better than it did while it was streaming through the Flash browser plug-in.
    As more of my video entertainment moves to the web and Flash, I'd really like to be able to stream the audio directly through WASAPI. Is there any hope of Adobe or a third party enabling this? Or is it intentionally prohibited as a way to block bit-perfect capture of DRM limited media?
    If DRM is the limiting factor, I'd suggest Adobe re-consider...  Pirates rarely care about small improvements in sound quality. Much Flash content can already be intercepted in bit-perfect form if one takes the time. It is mainly honest users operating within the intended streaming format who lose quality due to the browser plug-in routing audio through Windows Mixer.

    I second this reqest. The archaic waveout API used currently has quality issues in Vista and later. It's crazy when you consider people pay for AV content in some cases and can't get the full quality their hardware is capable of.

  • Java 5, AWT in headless mode and X11 Libraries

    Hi All,
    In Java 5, does AWT still require X11 libs to be present (not running or started) when using AWT in headless mode ?
    What level of grahpics (non GUI) activities can you perform with Java 5 and AWT in headless mode.
    Cheers

    i found something here...
    http://forum.java.sun.com/thread.jspa?threadID=444149&start=10&tstart=0

Maybe you are looking for

  • Can anyone tell me if the Hard Drive in my macbook6.1 is compatible with my daughter's macbook3.1.

    I need to upgrade my hard drive in my macbook6.1 will the current drive work in my daughter's macbook3.1 would increase capacity on both computers with one purchase (I hope). Thanks

  • Deployment of simple jsp application in Oracle 10g AS

    Hi All, This is a critical issue. We have a JSP application which uses the plain old java objects to esltabilsh database connection and same old java objects to perform the business logic. All java file are packed in a jar file and all jsp's and othe

  • Horizontal Output With Table

    Hi folks, - Let's say that the results of a query were 15 items - normally they would be listed vertically one at a time like: item1 item2 item3 item4 item5 etc. Q: I'm curious if there is a technique to list them a few different ways like: - Horizon

  • Help files won't open

    I just installed PSE 7 on Windows XP Pro and the help files will not open and I can't connect to online resources through the program.  Can anyone help me?

  • Can a user be part of two Experience Definitions?

    Hi, I have two questions: 1. Is experience defintion the only way of defining a different look & feel including navigation for a set of users? 2. Can a user be part of two experience definitions? If yes, which experience definition he will see? Can t