Set full screen mode

Hi everyone
It may not seem a JMF problem but i am hoping for some help.
I am just trying to implment full screen on jmf player panel, i tried but the nothing is shown but a black screen
the following is the code of whole program:-
import java.awt.*;
import java.awt.Rectangle;
import java.awt.Dimension;
import java.awt.event.*;
import javax.media.*;
import javax.media.Player;
public class MyPlayer extends Frame implements ControllerListener
     private Player player;
     private Panel panel;
     private String [] urls;
     int currentsong = 0;
     MediaLocator ml;
     int flag = 0;
     int videoWidth = 320, videoHeight = 200, controlHeight = 30;
     Dimension size;
     Component visual, control;
     private Dimension dimFrameSizeBeforeFullScreen = null;
     private Window windowFullScreen = null;
     public static void main(String[] args)
          String[] files = { "Khalid_Diana.mpg", "11.mpg", "Taha.mpg" };
          MyPlayer Medialist = new MyPlayer(files );
          Medialist.nextMedia(0);
     public void setFullScreen() {
          System.out.println("Full Screen");
          Dimension dimScreen;
          Dimension dimPrefSize = new Dimension(500,300);
          Rectangle rectVideo;
          panel = new Panel();
          panel.setLayout(new BorderLayout());
          //if (panel == null)
          //     return;
          dimScreen = Toolkit.getDefaultToolkit().getScreenSize();
          System.out.println("Screen Size: " + dimScreen.toString());
          if (windowFullScreen == null)
               windowFullScreen = new Window(this);
               windowFullScreen.setLayout(null);
               windowFullScreen.setBackground(Color.black);
          windowFullScreen.setBounds(0, 0, dimScreen.width, dimScreen.height);
          rectVideo = new Rectangle(0, 0, dimScreen.width, dimScreen.height);
          if ((float)dimPrefSize.width / dimPrefSize.height >= (float)dimScreen.width / dimScreen.height){
               rectVideo.height = (dimPrefSize.height * dimScreen.width) / dimPrefSize.width;
               rectVideo.y = (dimScreen.height - rectVideo.height) / 2;
          else{
               rectVideo.width = (dimPrefSize.width * dimScreen.height) / dimPrefSize.height;
               rectVideo.x = (dimScreen.width - rectVideo.width) / 2;
          Toolkit.getDefaultToolkit().sync();
          windowFullScreen.add(panel);
          panel.setBounds(rectVideo);
          windowFullScreen.setVisible(true);
          windowFullScreen.validate();
     public MyPlayer(String[] files)
          addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    if (player!=null) player.close();
                    System.exit(0);
               try{
                    Thread.sleep(2000);
                    setFullScreen();
               }catch (Exception e){
          urls = files;
          //setTitle("Player");
          //panel.setBackground(Color.BLACK);
          //add(panel);
          //setLocation(300,250);
          //setSize(500, 500);
          //setResizable(false);
          //setVisible(true);
     public void nextMedia(){ nextMedia(0);}
     public void nextMedia(int index)
          try
               ml = new MediaLocator("file:D:/Temp/" + urls[index]);
               player = Manager.createPlayer(ml);
               player.addControllerListener(this);
               player.start();
          catch(Exception x) { x.printStackTrace(); }
     public void controllerUpdate(ControllerEvent ce)
          if (ce instanceof RealizeCompleteEvent)
               visual=player.getVisualComponent();
               if (visual !=null)
                  // size=visual.getPreferredSize();
                    //videoWidth=size.width;
                    //videoHeight=size.height;
                    panel.add( "Center", visual);
               else {
                  // do nothing
               if ((control=player.getControlPanelComponent())!=null)
                    //controlHeight=control.getPreferredSize().height;
                    //panel.add("South", control);
               //setSize(videoWidth+10, videoHeight+controlHeight+30);
               //validate();
               //repaint();
          else if(ce instanceof EndOfMediaEvent) {
               player.close();
               player.deallocate();
               panel.removeAll();
               nextMedia(currentsong=(currentsong+1)% urls.length);
          //System.out.println("\n " + urls[currentsong] + " : " + ce.toString() );
          //else if ( ce instanceof FormatChangeEvent){}
}Thanks in advance

My problem is solved !
Following is code of how to set full screen mode:-
mport java.awt.*;
//import java.awt.Rectangle;
import java.awt.Dimension;
import java.awt.event.*;
import javax.media.*;
import javax.media.Player;
import javax.swing.*;
public class MyPlayer extends JFrame implements ControllerListener
     private Player player;
     private Panel panel;
     private String [] urls;
     int currentsong = 0;
     MediaLocator ml;
     int flag = 0;
     int videoWidth = 1024, videoHeight = 768, controlHeight = 30;
     Dimension size;
     Component visual, control;
     private Dimension dimFrameSizeBeforeFullScreen = null;
     private Window windowFullScreen = null;
     Container content = getContentPane();
     public static void main(String[] args)
          String[] files = { "Khalid_Diana.mpg", "11.mpg", "Taha.mpg" };
          MyPlayer Medialist = new MyPlayer(files );
          Medialist.nextMedia(0);
     public MyPlayer(String[] files)
          setBackground(Color.BLACK);
          setUndecorated(true);
          Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          System.out.println("\n\n The Screen DIM: " + screenSize);
          content.setBounds(0, 0, screenSize.width, screenSize.height);
          addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    if (player!=null) player.close();
                    System.exit(0);
          urls = files;
          setTitle("Player");
          panel = new Panel();
          panel.setLayout(new BorderLayout());
          panel.setBackground(Color.BLACK);
          add(panel);
          pack();
          //setLocation(300,250);
          setSize(1024, 768);
          //setResizable(false);
          setVisible(true);
     public void nextMedia(){ nextMedia(0);}
     public void nextMedia(int index)
          try
               ml = new MediaLocator("file:D:/Temp/" + urls[index]);
               player = Manager.createPlayer(ml);
               player.addControllerListener(this);
               player.start();
          catch(Exception x) { x.printStackTrace(); }
     public void controllerUpdate(ControllerEvent ce)
          if (ce instanceof RealizeCompleteEvent)
               visual=player.getVisualComponent();
               if (visual !=null)
                   size=visual.getPreferredSize();
                    videoWidth = size.width;
                    videoHeight = size.height;
                    panel.add(visual, BorderLayout.CENTER);
               else {
                  // do nothing
               if ((control=player.getControlPanelComponent())!=null)
                    //controlHeight=control.getPreferredSize().height;
                    //panel.add("South", control);
               validate();
               repaint();
          else if(ce instanceof EndOfMediaEvent) {
               player.close();
               player.deallocate();
               panel.removeAll();
               nextMedia(currentsong=(currentsong+1)% urls.length);
          //System.out.println("\n " + urls[currentsong] + " : " + ce.toString() );
          //else if ( ce instanceof FormatChangeEvent){}
}By the way thanks Stefan for being supportive

Similar Messages

  • How to use the set full screen mode ?

    hai...i' a newbie ..i hav one question ...how to use the set full screen mode for my application..
    i found.
    public void setfullscreenmode (boolean mode)
    but when try in my application it error and other
    canvas.setfullscreenmode(true);
    actually i don't know where i should put this code

    i also found the coding it use like
    setFullScreenMode (true);
    but when i apply it ..it error because cannot resolve the symbol.
    my question is which one i should use; declare the
    public void setFullScreenMode (boolean mode);
    first or use
    setFullScreenMode (true) ;
    or other way ..what i need to do to use setFullScreenMode

  • Full screen mode PDF created on Mac not working on PC?

    I've created a PDF presentation on a Mac in Adobe Acrobat 8 Professional with about 80 pages. I've set it to open in full screen mode when viewed, which works fine on Mac when tested. When opened on a PC however, in my clients corporate environment, it does not work? Has anyone else come across this problem or have any suggestions to remedy it? Could it be something to do with the system it is being opened on blocking full screen mode?

    Check this out in Acrobat help type : Full Screen Mode
    look at the following topics:
    Defining initial View as Full Screen Mode
    Defining initial View
    It appears Fullscreen mode is based on OS Specifications So you need to reopen on a PC version of Acrobat  and set it again.
    Looks like they could have both settings in both programs that is a Line that says set full screen mode for Mac PC Unix Linux set for all.

  • Cannot get slide show in full screen mode to come up on secondary monitor regardless of how I set up show it always opens on primary screen.  Need some help here.

    Slide show in PowerPosint for mac 2011 on iMac will not open full screen mode on secondary monitor.  Regardless of how I set the slide show preferences it always opens on primary monior with secondardy monitor having totally balck screen.  Need some help if anyone else has run into this problem.

    You should contact Microsoft for Mac Support  and/or post in their forums.

  • Is it possible to set a finder window to full screen mode,..

    ... like mail, itunes and other apps? and if not, why not?
    I have to say it took me a bit to get used to Lion, I began complaining all day until I decided to take some time to learn it, and now I like it very much, I see the advantages over 10.6.
    But still, there are some things I don't know about, and the window of opportunity to take time to learn more has closed. And I don't know when it'll open again.
    So, that's why I have joined the community, because now I'm trying to use everthing on full-screen mode, and as I was setting my desktops to work on a project in which I will be needing a lot of finder windows open with a lot of items each, I instantly asked myself:
    Is it possible to set the finder windows to full screen? because I don't see any buttons.
    Thanks 4 Your Time
    R.D.B.

    Thanks Don Archibald,
    Yeah, that's what I'm doing at the moment. But I thought it would be nice to have the little full screen button just to press it so.
    Besides, I'm still figuring out the finder windows' behaviour. I discovered that if you open a folder from a window that has the toolbar, the new folder would also open with a toolbar, even if you already had it set it up with just the status bar.
    And one thing that still enervates me is that if you have a window with two items, and you press the green button to fit the borders up tight, instead of leavin' the 2 items in a horizontal arrangement, it moves one to the bottom and puts a slider. Arrgh.
    Another thing I haven't understood is why one folder I have on the dock sometimes opens with a column layout instead of the icon layout I have arranged for it before. Totally random 4 now, can't find the why.
    Anyway... I'm going to order some lapel pins about 2 flags I designed for two embassies. Anyone know a good place for doing that?

  • How do I set Firefox to start on login in full screen mode and permanently disable the tool bars?

    I am trying to set up a touch screen windows 7 lenovo desktop for use by older users with no prior experiance of PC's. I would like Firefox to start on login and open in full screen mode, with all toolbars disabled. Is this possible? and if so how do I go about doing this?

    If you close Firefox 4 while in full screen mode then the browser should start in full screen mode the next time. That setting is stored in localstore.rdf in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder].
    If you want to prevent toolbars from opening if you hover to the top then hide the full-screen-toggler with code in userChrome.css
    Add code to userChrome.css below the @namespace line.
    * http://kb.mozillazine.org/userChrome.css
    * http://kb.mozillazine.org/Editing_configuration
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #fullscr-toggler { display:none !important; }
    </nowiki></pre>

  • Unable to set safari in full-screen mode

    Hi folks,
    I just factory reset my 15-inch MBP running 10.9.3. After doing so, I notice that I am unable to set Safari in full-screen mode. Any ideas??

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Please take this step regardless of the results of Step 1.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • How to set the full screen mode using setClip method

    hi all,
    how to set the full screen mode using setClip in that softkeys should not be used insteat on that need to create a own softkeys using commands.
    thanks & regards
    Bala.

    In CS5 there are changes made to how the screen mode is reported. In CS3-CS5 the screen mode has a corresponding number. So for instance if the ScreenMode is set to "Preview Off" and you ask indesign CS3 or CS4 to display the screen mode, it will report "1936552047", while in CS5 it will report "PREVIEW_OFF".
    try executing this simple command in respectively CS3, CS4 and CS5 and you will see what I am talking about:
    alert(app.activeWindow.screenMode);
    there is no difference if you do:
    alert(app.activeDocument.layoutWindows[0].screenMode);
    The CS5 solution is rather awkward to work with, unless I am missing something? PREVIEW_OFF is not a string, nor is it a number.
    Example -  doing:
    myScreenMode=app.activeDocument.layoutWindows[0].screenMode;
    and then trying to reset screenMode by something like:
    app.activeDocument.layoutWindows[0].screenMode= myScreenMode
    does not work in CS5 of course. It will throw an error. Neither will this line work:
    app.activeDocument.layoutWindows[0].screenMode=ScreenModeOptions.myScreenMode;
    Any way of working around this?

  • I pressed something, and it made the browser go into a "full screen" mode, how do I change it back? And also, something happened and made my FireFox text on all internet pages smaller, is there any way I could change this setting?

    I had pressed a button on my keyboard which made my text and pictures and the whole page smaller in size, can I change that? And how could I change my browser out of "Full Screen" mode?

    You can press F10 to toggle (View) Full Screen mode.
    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages

  • Cover Flow does not update in full-screen mode

    Following an upgrade to iTunes 10.5 (141) and Lion (10.7.2) - I've noticed that Cover Flow no longer updates to the current song in full-screen mode. It will return to, and remain frozen at the first song of the playlist until manually updated or I revert to non-full-screen mode.

    I assume you are using a desktop shortcut to start Lightroom.  Look at the properties for that shortcut.  There should be an option to set it to "maximize".

  • Aperture 3.1 - Love Full Screen Mode, Hate The System Lock-Ups

    Hi Guys,
    I don't know if I'm the only person encountering this issue but Aperture 3 is driving me nuts. While I absolutely love the program and the full-screen mode, what I hate is the frequent lock-ups that force me to completely restart my iMac. Having the application lock-up is highly annoying but at least in "normal" mode I could kill the application from the Dock or Activity Monitor. However, when I'm operating in full-screen mode then I can't switch out of the application and seem to have no option but to completely restart my computer. This problem, which I first started experiencing with version 3.0 but which does seem to have been addressed in version 3.1, is happening so often that I'm afraid now to even use full-screen mode.
    This problem only, to my memory, seems to happen when making adjustments but it does not seem to matter which adjustment. In the most recent occurrence the lock-up happened when I cancelled the application of a Crop by clicking the X icon on the Crop HUD.
    Does anyone know either a) what might be causing the lock-ups, or b) how I can kill Aperture without having to completely restart my computer?

    You could also set up SPACES to see if that works when lock up occurs in full screen
    Apple Icon > System Preference > Desktop & Screen Saver > Hot corners
    I have bottom left set to spaces
    Then drop the mouse to bottom left, 4 windows appear, drag aperture to a seperate window and run there, you desktop is in a different space and can be accessed by bottom left of screen mouse movement (if the mouse works when A3 locks up)

  • Please help: Linking from PDF to other PDF's that open in a new window... but NOT in full screen mode!?

    Hi All,
    I have a project where a PDF is viewed in full screen mode when opened, from within this I wish to link to a variety of other PDF's.
    Creating the links is simple, however I can not work out how to control the new window so that the new PDF opens with the toolbars and menus, ie not in full screen mode.
    Any help would be apreciated, google is not my friend on this one.
    LB.

    Hi Thanks for the response.
    I thought I had, but what seemed to be happening was that the Linked PDF was
    adopting the full screen property of the original PDF. I'll give it another
    go and let you know.
    LB
    2009/5/10 Steve Hart <[email protected]>
    Have you tried setting the initiall view properties of those PDFs to what
    you want?  Go File>Properties>Initial View.
    >

  • In Full Screen mode Safari only opens new tabs?

    Safari 5.1 has a preference that lets you set whether or not targeted links open into new tabs or new windows.
    In regular screen mode, this preference works as expected.
    In Full Screen mode (Lion), this preference seems to be ignored, and Safari always opens targeted links into new tabs.
    Is there a preference I'm missing to set this behavior for Full Screen mode?
    The reason I ask is that I would love to use the swipe gesture to switch between different web pages I have open, and so far Safari only seems to use gestures in Full Screen mode to switch between windows, not tabs.

    Hi there i tried... I think prey locked my computer..:(
    Infact i know it did because i just got out...after making changes in prey ...**** that is one **** of a program...
    Im across the bay... Its cold tonight. :).

  • When I go into full screen mode in Safari 5.1 on LION it switches to a new Space, making my other displays useless. Anyone else annoyed that Apple has completely left out those with multiple displays?

    I had a fear that this was going to be the case, but you can't have two full screen apps open in two different displays. At least that's how Safari fullscreen works. When switching over to full screen mode in safari, it automatically creats a new space, turns on four finger gesture to swipe through full screen apps which I had turned off in place of App Switcher.
    I don't use spaces because of the lack of support for using spaces with multiple displays. I would use spaces and mission control if I had control of each display's mission control separately.
    The fix would be to unlink the displays so they can scroll through full screen apps by themselves. I want this feature so I can mix and match the full screen apps on my three different displays. I see this beneficial for more people with multiple displays. in the future when thunderbolt display links, people will want better support too.
    I know I would use spaces and mission control more if I could have this ability. I'd be interested to know people's opinion.

    No no, if you read what I said, it would be that each individual display would be customizable to the user. The way you have it, it sounds like your second display will be dedicated to scrolling through fullscreen apps not allowing you to do it on the home screen. This is silly because with my concept, you could do that, by dragging apps to fullscreen in your second display, but if you want you could tell another display to scroll through fullscreen apps (independently) if you wanted. Each display will have it's own mission control with it's own set of desktops. I also can see how some people would still want them linked together, so this could just be a little check box made in mission control prefs to "link" or "unlink" desktops with link checked by default.
    With your solution you're limited to your setup. but what if the person has three or four displays? Well then your solution would limit them to one dedicated display that scrolls through fullscreen apps where mine lets a person customize their desktops depending on their preference and setup.
    further example: if you have safari, address book and mail in one display, you could still have ichat, PS and Illustrator in your second, and a text editor, FTP Client and iTunes in your third. Then you would mix and match these apps but it would promote the use of mulitple displays as well as benefit people with three or more, which thunderbolt, Cinema Display and Pro computers support.

  • ScreenSaver coming on when in Full Screen Mode

    Hi Guys,
    My father-in-Law got the Quicktime pro 7 for windows, I still haven't been able to get him to buy a mac... but that's another story. When we installed the software on his laptop, everything works fine, but when watching an .mp4 file, we noticed that along the way every 15 mins the screensaver would take over the screen, we where watching in full screen mode, this of course it not right cause in my Mac, no screensaver takes control away from quicktime in full screen mode. We had to reset the screensaver to never for us to watch the .mp4 file.... please fix this in the next windows update. Or let's us know what settings to use for this not to happen. Thanks

    Most screen savers allow the user to set the "time" when they start.
    Set the delay longer than the QuickTime file.
    Send to "Feedback" to request changes in the software. This one bugs me at times, too.

Maybe you are looking for

  • Wrap up

    Hi Is it possible to tie wrap up data to a queue rather than a work flow / agent? I want to display a set of wrap up codes based on which queue the call was in , as I have an agents with many skills I can't just select one work flow group or do I jus

  • Turned off Layers visible on PDFs in Mac Products

    I have several documents with what I call "reference layers" in them that I turn off when making a PDF. When I view the PDF on a Windows based machine, it is fine in both FireFox and IE. When viewing the PDF on a Mac product (iPad, iPhone, Mac deskto

  • Finding a page title

    I'm trying to build a dynamic page navigation portlet (based on the the three structure of the pages). Like the "Display Child Pages As Links" - functionality. But I can't find the page titles anywhere. In the WWPOB_PAGE$ table only the title_id is t

  • Newbie HELP - JSP includes

    Hi, I want need to create JSP pages which will have (1) Header (2) Body and (3) footer. The header and footer i am clear about including. But the body has to have two parts (a) a fixed sidebar part with hyperlinks and on the rights side (b) body cont

  • PSE 8 - Can't Get Past The Stupid Ad for PSE 9

    I work in IT so I generally have a fair amount of patience with software/hardware problems, but this time I am really annoyed.  This is the second time Adobe has pushed an advertisement for PSE or online storage to my PC and each time it has been imp