Fullscreen exclusive problems!

I have noticed that if I set my device to anything less than 640x480, The mouse thinks the screen is larger. You can drag the mouse like a whole 3 inches off the bottom of the screen which should be impossible, any way around this? A resolution of 512x384 really beefs up rendering smoothness.

2.1.8.5?! Ack! You REEEAAALLLY need to upgrade. There's been about 5 billion driver releases between those and the ones we use now (4.3.4.9). Trust me, once you upgrade, Windows will magically look better, animation will be smoother, and your framerates will be higher.

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);
    };

  • 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.

  • 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

  • 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...

  • 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 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...

  • 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...)

  • Css shadows/Fullscreen video problems

    Hello,
    At some point I've started to have problems with FF displaying css shadows and fullscreen videos.
    1) Here's an example of how css shadows look like on a variety of sites when openned in FF: http://xmages.net/show.php/2871278_css-png.html . Chromium displays the same sites perfectly.
    2) There's some kind of a problem with the switching to the fullscreen mode. For example at imdb.com when I click the fullscreen mode button - the video itself starts underneath the browser window and can be switched to with ALT+TAB. Again - Chromium works fine there.

    Try to disable hardware acceleration.
    * Edit > Preferences > Advanced > General > Browsing: "Use hardware acceleration when available"

  • 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......
              }

  • 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();

  • LabVIEW, MSAcess, and Database Toolkit (Exclusivity Problem)

    Hi all,
    I have recently developed an application that's used for testing production products and sends the final test data to a MS Acess database via the database connectivity toolkit.  We've run into a problem with it though.  This program needs to be able to run at all times, its a high flow production line.  During production though, we have a large group of engineers that need access to this data.  Its set up so that only myself and one other person have write access to the directory containing the database, everyone else can only open it as read only.
    The problem I'm running into is that whenever the database is open by one of the two engineers with write access OR any one of the other people just going in to review data as read only - the production tester isn't able to save records their creating in LabVIEW.  No warning or notice is given to the user in form of error to indicate the data wasn't stored.
    I'd like to get this problem fixed but the last time I tried to use the Username/Password inputs on the connectivity VI I ended up locking up access and we finally resorted to just making a new database.  Given the amount of data in there now, you could say I'm a little "gun shy" about randomly fooling with the security settings again without a good idea of how to accomplish fixing this.
    Basically I just want for that database to be opened exclusively by labview, and prempt anyone who is logged in (aside from one of us with write access...its a small enough group we are fine with just closing the test program for a few minutes while we make changes)
    Any ideas on how to do this?
    LV7.1, LV8.5

    Hi Dennis,
    Our IT guys tend to push SQL also.  How much work is it to switch over to the other?  
    You know I'm not sure if its worth it at this point, at most we only have 1-2 people on the database at once.  The test computer is always on which brings that number to 1, and it only happens maybe once a day that someone looks at the database and only to check some values in 1 record - then they close out.  Aside from the tester, no one else is in there for more than 1-2 minutes tops maybe once every other day.  Its just during that time if the user submits his report in that 1-2 minute window - we don't find out about it until someone needs to view that record.  
    A worst case scenario though is if someone gets in for their 1-2 minute window and gets a call or gets distracted and forgets its open :-/
    I did try some quick research....it looks like one recommendation might be to make a "front end" basically another database with a form linked to the data stored in the tables of the original one.  That way anyone viewing doesn't go into the storage database itself.  I haven't tested this yet though...one question comes up -if they are in this front end thats linked...I wonder if that is considered a "constant connection" to the storage database and we'd still run into the same problem with the storage one "thinking" its open anyhow...
    I dunno this database stuff is a bit loopy imho.
    LV7.1, LV8.5

  • Flash Fullscreen Size Problem

    So, call me ridiculous, but I use 64 bit software whenever possible because I have a 64 bit OS with 64 bit CPU cores. Naturally, then, I use a 64 bit web browser: Firefox (nightly). This means I need a 64 bit version of flash which is still in a horrible beta flux: http://labs.adobe.com/technologies/flas … 10/square/
    The problem: the Fullscreen functionality of flash opens a new window (good) but with the video not actually full... screen (bad). Pictures are more descriptive:
    I've been seeing this problem for a little while though, and wanted to know if it's happening to anybody else -- especially if they've found a solution.
    And yes, I watch videos about lettuce.
    Last edited by secretrobotron (2011-06-01 00:57:25)

    Ooooooh. Looks like it's some third-party problem. Everyone must be using the same video player library for streaming.
    Ignore this. It's a much wider problem.

  • Flv fullscreen playback problem

    I have a strange problem.In flash CS4 I import a .flv video to stage with one-of-those built-in skins with fulscreen control.I have set"flash only- allow full screen" in publish settings->HTML.Now when I publish the movie in HTML the fulscreen function does not work.The movie goes fulscreen for a moment
    but returns to normal view immediately.This happens in both Google Chrome and IE8.I have no clue what I am doing wrong.Please help.

    I mean sir, when I click on one of the imported videos the video itself covers the entire screen. What i need is when i click the button for video 1, for sample, it will load with the size i manually transform on the stage.. and when the time comes i press the FULLSCREEN button on the "SkinOverAll.swf" that when the fullscreen happens..
    Again, my settings stageDisplayState is FULL_SCREEN and scaleMode is NO_SCALE on the first frame. So, when i go and click the tab for video page it started fullscreen. The problem happens when i started clicking on one of the buttons on the video page, the screen all turns to black.. And when i hit ESC the screen turn to normal and no video is playing.. Tried playing the video, it work fine and press the FULLSCREEN BUTTON work fine too {that's because the stageDisplayState is NORMAL..
    I hope that you could really help with this one.. I have a deadline tomorrow..
    Thanks again,
    YSONG

Maybe you are looking for