No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.5 | 17 ratings Rate this file 14 Downloads (last 30 days) File Size: 1.18 KB File ID: #11112 Version: 1.0




18 May 2006 (Updated )

Display fullscreen images on multiple displays

| Watch this File

File Information

The package contains an m file for displaying fullscreen matlab RGB images. The user can specify the display number for the image to be shown. This is a cross platform solution using Java function built into Matlab 7.x and has been tested on Windows and Linux machines.


This file inspired Fullscreen 1.1.

MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements Matlab 7 and above running JVM Works on Linux, Windows and possibly Mac OSX (untested).
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (30)
19 May 2016 go9kata

works with Matlab 2015a under Mac OS X Yosemite

06 Jul 2015 Rakshit Kothari

This solution is perfect. I can confirm that it works well with MATLAB 14(b)+ editions.

07 Jul 2014 Will Reeves

23 May 2014 Emilian Lalev

11 May 2013 Giacomo Morandi

14 Mar 2011 Kazutaka

Either if I use an Embedded Matlab function block or a level 2 S function, Java is not supported...

Comment only
13 Jan 2011 Michal

Michal (view profile)

Hi, I have been trying ver 1.1 of fullscreen and I have a following problem. After executing two fullscreen commands corresponding to the two screens I have, the former screen goes back to the usual mode (leaves full screen). Does anyone know what I can do about this i.e. to keep full screen images in both screens and not only in the one which was issued the fullscreen command as the last one?

Comment only
03 Jan 2011 Kazutaka

Is there a simple way to use this function with real time windows target to update images on full screen? I will only have several images to display... Anyone?

17 Dec 2010 Nawar

Nawar (view profile)

I just tried what Sedat suggested and it works which is as follow:

change the line:
frame_java = javax.swing.JFrame(gds(device_number).getDefaultConfiguration());
frame_java = javax.swing.JWindow(gds(device_number).getDefaultConfiguration());
then remove line : frame_java.setUndecorated(true);

Thank you Sedat

Comment only
17 Dec 2010 Nawar

Nawar (view profile)

Yes it can be used with projector and thats what I am using but the problem is"The Java screen always gets minimized when I clicked on matlab window or the desktop of the first monitor"

Anybody fixed this problem.

Comment only
09 Nov 2010 Munther Gdeisat

can use this with a projector

Comment only
16 Sep 2010 sedat

sedat (view profile)

@mike change the line
frame_java = javax.swing.JFrame(gds(device_number).getDefaultConfiguration());
frame_java = javax.swing.JWindow(gds(device_number).getDefaultConfiguration());
then remove line : frame_java.setUndecorated(true);

it should work now

Comment only
18 Aug 2010 Mike

Mike (view profile)

Same as the above comment. I tried to display full screen on a second monitor. The Java screen always gets minimized when I clicked on matlab window or the desktop of the first monitor.

15 Jun 2010 serdolik serdolik

This function works very well while i have WinXP and R2009a, but when i changed it on Win7 and R2010a the window with my image is minimize when I go to the other app or click on the desktop and I can't do anything with this. Any suggestion? I have the last java updates.

Comment only
23 Dec 2009 Marvin

Marvin (view profile)

Pithawat Vachiramon Thank you very much for your contribution, I going to incorporate its role in my thesis project, I use an interferometer on an LCD projector for measurement of 3D objects. I will remember to mention your name when my thesis is finished, my best wishes to you, happy 2010.

Comment only
02 Dec 2009 Pithawat Vachiramon

Hi Leonardo, have you tried the 1.1 version of the routine?

Comment only
28 Oct 2009 Leonardo

On Mac OS 10.5 fullscreen works well. Unfortunately, closescreen leaves me with a completely black screen, with only the mouse pointer on it. I have to switch the Mac off.
Sorry my naive tone, I don't know anything of Java, computer graphics etc. I would be very grateful if someone could give me some hints.
Thank you.

Comment only
21 Aug 2009 Laurent Sansnom

oops last link:

Comment only
21 Aug 2009 Laurent Sansnom

Great utility. Note that I had a problem when using 2 devices with different resolutions. Java would indicate both screens had the same resolution (primary screen res). This is a java bug:

Using JVM 1.6 instead of 1.5 solved the problem (instructions on


14 Apr 2009 Pithawat Vachiramon

Thanks Alejandro, I have implemented your fix and speeds up the function in Fullscreen 1.1 (

Comment only
13 Mar 2009 Alejandro Camara Iglesias

There is a problem with non-exclusive-fullscreen-capable screens: Java tries to emulate the fullscreen resizing the frame to the size of the screen and placing it in the position (0, 0) of the specified screen. The problem is that (0, 0) is an absolute position and places the frame into the _first_ screen no matter what screen you specified.

This code can be easily modified to fix that issue paying attention to the following thread on the Sun forums:

Place the next statement after frame_java = javax.swing.JFrame( gds( ... :

bounds = frame_java.getBounds();

And the following after the setFullscreenWindow() statement:

frame_java.setLocation( bounds.x, bounds.y );

That will make the trick :-) At least it does in my computer.

Alejandro Cámara Iglesias

01 Oct 2008 Chris Nafis

Thanks for writing this. It works great for me

23 Sep 2008 Drew Wagner

The java environment on os x seems to detect only the primary display. I'm trying to find an automated way to change the primary display, but I haven't found one yet. The applescript dictionary for System Preferences is quite sparse.

Comment only
22 Jan 2008 Edoardo unical

Very good to show an image on the main display, but it doesn't work on the second display. Does anyone know any fix for this problem?

20 Nov 2007 Evan Tsai


05 Jun 2007 aniket vartak

peter zoon below is right, I tried using it with 2 screens, and doesn't show up on the screen..does any body have a fix..or a place to look for it!??Thanks

03 Jun 2007 aniket vartak

just what i needed..have to fix the issue of the image not being similar size of the screen...but an easy fix for myself...thanks!!!

16 May 2007 Jens Rantil

Great scripts, thanks!

I've had some small problems with latencies when changing from one fullscreen image to another. This is because IM2JAVA takes a lot of time. If you need to use a fast fullscreen implementation I recommend you to load preload all the images and convert them directly to Java image format.

This of course requires that you tweak the fullscreen script a little, but it's not too hard.

15 Jan 2007 peter zoon

Indeed a very great program this is exactly what i have been looking for, however it only seems to work on my primary display.
device_number has values of 1 and 2.
gds shows [sun.awt.Win32GraphicsDevice]
But if I try to disply it like fullscreen (image,2) still pops open on monitor 1

08 Jun 2006 Evgeny Frumker

Great program

Contact us