Problem with drawing Swingcomponents over the Videocomponent

Hi there,
I'm trying to draw a simple Swingcomponent over a running video - I read in the Forums for days - nothing helped. I don't know why it still don't work.
LIGHTWEIGHT_RENDERER is already used
JLayeredPane is already used
Please help me - I don't what I can do anyway
public class MySecondJMFApp extends JFrame implements ControllerListener{
     private Player player;
     public MySecondJMFApp(){
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          try {
               Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
               player = Manager.createPlayer(new MediaLocator("file:C://video.mpg"));
               player.addControllerListener(this);
               player.realize();
          } catch (Exception e) {
               e.printStackTrace();
     public synchronized void controllerUpdate(ControllerEvent e) {
          if(e instanceof RealizeCompleteEvent){
               this.setBounds(0, 0, 800, 600);
               this.setLocation(0,0);
               JLayeredPane layeredPane = new JLayeredPane();
               layeredPane.setPreferredSize(this.getSize());
               layeredPane.setLocation(0,0);
               this.add(layeredPane);
               Component video = player.getVisualComponent();
               video.setLocation(0, 0);
               video.setSize(this.getSize());
               JLabel label = new JLabel("THIS IS A RED TEXT");
               label.setForeground(Color.red);
               label.setOpaque(false);               
               label.setLocation(0, 0);
               label.setSize(this.getSize());
//also tryed     label.setSize(this.getSize().width + 1, this.getSize().height + 1);
               layeredPane.add(video, new Integer(1));
               layeredPane.add(label, new Integer(10));
               player.start();
               this.setVisible(true);
     public static void main(String args[]){
          MyFirstJMFApp jmf = new MyFirstJMFApp();
}

Hi there,
I solved the problem by myself :-)
I read the API-Documentation again and again until I recognized the little "try" in "JMF trys to create a lightweigt Component". So I tried some other videos and realized - this Code is definitly working if JMF is able to create a lightweigth Component. In some cases I saw the red text - in other cases not.
Good luck, if you have the same problem like I got ;-)

Similar Messages

  • Problem with file transfer over the net

    Hi!I'm trying to make a program that allows to send/receive files and I'm almost done,except for a little problem:the file received has some bytes missing at the end!
    For example if I send a text the last 2-3 lines are missing,same thing for an image,an html document,etc.,although the file opens without any problem.As transport-level protocol I'm using TCP so it's not a networking problem,I think the problem is in the application layer so I post here the code,hoping someone helps me out(in this example I'm trying to send an image .jpg):
    Sender:
    Socket connectionSocket=new Socket("ipadress",port);
    FileInputStream source=new FileInputStream(System.getProperty("user.home")+"\\Documents\\image.jpg");
    BufferedOutputStream send=new BufferedOutputStream(connectionSocket.getOutputStream());
    int c;
    while ((c = source.read()) !=-1)
                    send.write(c1);
    Receiver
    ServerSocket receiverSocket=new ServerSocket(port);
    Socket  connection=receiverSocket.accept();
    BufferedInputStream rec=new BufferedInputStream(connection.getInputStream());
    FileOutputStream receivedFile=new FileOutputStream(System.getProperty("user.dir")+"\\received.jpg");
    int c;
    while ((c = rec.read()) != -1)
                    receivedFile.write(c);I think the problem is in this code:somehow the sender stops sending bytes before the end of the file is actually reached...what do u think?

    Thank you so much!At the end it was a very stupid mistake!:D
    Btw now that the main problem is solved I continue posting asking for your opinion:is this program for you efficient enough?Or there's a better way to do file transfer?

  • I've had a Samsung network extender for over a year and it's been great.  About a week ago, my iPhone 5 stopped connecting to it.  I've never had problems with this.  All the lights on the extender are blue, so it seems it's working fine.  Any suggestions

    I've had a Samsung network extender for over a year and it's been great.  About a week ago, my iPhone 5 stopped connecting to it.  I've never had problems with this.  All the lights on the extender are blue, so it seems it's working fine.  Any suggestions?

    Oh no! Lets ensure that you are connected. Have you tried to reset the Network Extender? Are other devices able to connect to the Extender? Is your Internet service up and running? 
    Share details so that we can help!
    Thank you, 
    LenaA_VZW
    Follow us on Twitter @VZWSupport

  • Error -43  when try playback on win7 64bits over the network QT that recide MacPro  osx 10.5 however i can play with VLC player, This happend when the QT is inside a Folder with name longer 8 chars other files has no problem with long names just the QT

    error -43  when try playback on win7 64bits over the network QT that recide MacPro  osx 10.5 however i can play with VLC player, This happend when the QT is inside a Folder with name longer 8 chars other files has no problem with long names just the QT  nfs sharing

    Never mind, I already found the solution myself.
    What I did wrong was:
    - not copying the master image to the nbi folder
    - selecting the netinstall-restore.dmg image as source to copy to my HD.
    The thing is, when you create a netinstall image for 10.5, the image itself is already included in the netinstall image so you don't have to do anything else.
    With the 10.4 image however, you also have to copy the master image to the NetBootSP0 directory.
    In the *.nbi folder contains an netinstall-restore.dmg file. But that is only to boot you to netrestore, it's not the image itself.
    Other alternative is to copy the images to another folder that you share with AFP and adjust the configuration of netrestore like described in this manual:
    http://www.shellharbourd.det.nsw.edu.au/pdf/misc/osxrestoringnet.pdf
    This manual was also how I figured out that I forgot to copy the image to the NetBootSP0 folder.

  • I keep having the same problem with my messages over and over again. My number is not checked in my message settings it just unchecks itself

    I keep having the same problem with my messages over and over again. My number is not checked in my message settings it just unchecks itself

    Dear Tomarshe
    I had the same problem a couple of weeks back.
    What I did was that I restarted that Ipad of mine and voila!
    Problem solved!
    hope this helped!
    - DASHdotDASHdot

  • Problems with File Transfers Over Firewire 800

    Problems with File Transfers Over Firewire 800.
    Over the past month, I have had problems when transfering files from my harddrive, over Firewire 800 to a portable drive. I usually transfer very large files (20gb or more) to the portable drives for moving files around. When I drag a file over to copy onto a drive, the transfer starts normally. If I drag more files to copy over, the computer screen goes darker and a large icon comes up that looks like a power button icon. It tells me to restart, so I have to do a hard shut down on my G5. Weird. I also get the dark screen of death sometimes when I am transfering those large files and open another application to do some work while it's copying. It's killing me. I am having to sit here and wait for the transfer to finish before I can do anything.
    Any thoughts...
    Dual 2.7 GHz PowerPC G5
    Mac OSX 10.4.3
    Dual 2.7 GHz PowerPC G5   Mac OS X (10.4.3)  

    Have you run the Apple Hardware Test? Sounds like it could be a RAM problem.

  • How to I get rid of the message your contacts or calendar is being synced with Mobile Me over the air

    I keep getting the message that my Contacts or my Calendar is being synced with Mobile Me over the air even though Mobile Me no longer exists on my computer or as an Apple product
    I have downloaded and am running the latest version of iTtunes running on a Win8 Pro 64bit machine
    Ernie

    It's because you must have sent some information like you must have clicked on Submit button to perform any query. So when you will click on back button it will again send this info.
    So, right click on Back button and choose 2nd site from the top of the list to go to previous page.
    ''<hr>Note: If anyone's reply has solved your problem, then please mark that reply as "Solved It" to the right of that reply after logging in your account. It will help us to concentrate on new questions.''

  • Problems with Photoshop cs4 for the Mac

    I am having all kinds of problems with Photoshop CS4 for the Mac.  When I boot the software it seems to work for a while then, I am unable to open upf a file in Photoshop.  I drag a photoshop file over the application icon, the whole screen flickers and nothing happens.  I am unable to quit Photoshop as the quit choice is grayed out and command-q will not make it quit. I have to force quit.  I can repeat this pattern over and over.  What is happening?  How do I solve this problem?
    --Kenoli

    Thanks for the reply.  I am using  Photoshop 11.0.1.  I am using the latest version of Snow Leopard.  I have found both Photoshop and Dreamweaver to be pretty buggy for several versions now.  My suspicions were that they were really engineered for Windows and never really fully implemented for the Mac.  Dreamweaver crashes or hangs on me three or four times a day if I us it all day and does various annoying things like refusing to respond to the delete key after I have used it for a while.  I have pretty much stopped using it to some degree for that reason and also because there is other software that does a lot of coding things I do much more directly and simply.  Also Dreamweaver always seems to struggle to quit when I tell it to quit (that is, it takes a long time and gets hung up at places before it quits) and once it does quit, I always get a message saying that it has unexpectedly quit (even when I have told it to quit).
    The problems with Photoshop  (starting with just taking a long time to load)  have escalated to the point I described today, which makes it almost unusable. I just reinstalled Snow Leopard to see if there was anything buggy in the system software.  I will report if problems go away.
    Regarding both the refusal to open image files and the grayed out quit command, made me think something like you, i.e. there was some dialogue box open somewhere.  However, I couldn't find anything and I don't use two monitors.
    So . . . Adobe just seems to be getting more expensive and more buggy.
    Incidentally, why is it still running in Rosetta rather than natively?  Adobe now has a real Intel processor to work with.
    --Kenoli

  • Safari have problems with streaming radio over flash

    Hello,
    since my update on MAC OS LION have my safari problem with radio streaming over flash.
    For testing: http://shoutcast.flashradio.info/#/House/814384/
    In all browsers on all platforms will this work. Just on the combination from MAC OS LION and Safari 5.1 we get the io error #2032.

     Try changing some Advanced wireless settings on the router. Open the setup page of the router and go to Wireless tab. Click on Advanced wireless settings. Change beacon Interval to 75, RTS threshold to 2304. Save the settings.
    Change the wireless channel to 11.
    An 802.11n router can also work with 802.11g and even 11b devices. But these much slower devices force the router to slow down to talk to them, which means a big throughput hit. Fortunately, the "legacy" mechanisms are pretty efficient and reduce throughput only when the slower devices are actively transmitting or receiving. Either upgrade to all 11n clients, or use a separate 802.11g router to handle your "legacy" stuff.

  • TS3694 good evening i have an problem with my iphone 4 the wif and network cant on now if i tray is showing iTunes i tray to reload the ios is showing an error -1 can you help me

    good evening i have an problem with my iphone 4 the wif and network cant on now if i tray is showing iTunes i tray to reload the ios is showing an error -1 can you help me

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • TS5376 I'm having a problem with downloading and installing the new version of itunes for windows (11.1.4)  I have done everything the troubleshooting article has said and it is still not working properly.

    'm having a problem with downloading and installing the new version of itunes for windows (11.1.4)  I have done everything the troubleshooting article has said and it is still not working properly.  I have even done a repair to see if that works and it has not.  Has anyone else found a new way to get it working?

    Try Troubleshooting issues with iTunes for Windows updates.
    tt2

  • HT1222 I am trying to update my phone so I can save my info on my old phone & get a new phone, but I get a error that says "There was a problem with downloading teh software, the network connection timed out.."  HELP!  Not sure what my settings shoud be..

    I am trying to update my phone so I can save my info on my old phone & get a new phone, but I get a error that says "There was a problem with downloading teh software, the network connection timed out.."  HELP!  Not sure what my settings shoud be...
    I never updated anything until now...I want o update my iPhone to the newest version, but i do not want ot loose all that I have on this phone. I was told I needed to update the operating systems so i can put things into the cloud for transport to new phone, but I am just not sure how to do this..Can you help out here??

    Dear Jody..jone5
    Good for you that can't update your iphone because I did it and my iphone dosen't work for example I can't download any app like Wecaht or Twitter..
    Goodluck
    Atousa

  • Hello , please am having a problem with my iphone 5 , the battery runs out quickly , also if i turn on 3G it will run faster , 15 minutes and the iphone battery will be out , and my final problem is that is "no service " appears a lot can you help ?

    Hello , please am having a problem with my iphone 5 , the battery runs out quickly ,another problem also if i turn on 3G it will run faster , 15 minutes and the iphone battery will be out . My final problem is that  "no service " appears a lot  especially when opening wifi or 3G , can you help ?

    Your battery is running quickly because your cellular data connection is weak.
    Is your phone carrier a supported carrier:   Wireless carrier support and features for iPhone in the United States and Canada - Apple Support
    For your no service issues:  If you see No Service in the status bar of your iPhone or iPad - Apple Support

  • HT1665 i have an apple IPhone4. I am experiencing certain problem with my iphone4. The problems are as follows a. my ear piece and proximity sensor is not working while making a call. 2. It cannot reproduce sound without earphone but rings if gets any cal

    Hi folks,
    i have an apple IPhone4. I am experiencing certain problem with my iphone4. The problems are as follows a. my ear piece and proximity sensor is not working while making a call. 2. It cannot reproduce sound without earphone but rings normally if gets any call.
    Can any one help me in this regard??

    Try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again. You will not lose data by resetting, but it can cure some glitches after installing new software or apps.

  • MacBook Pro 15 with Windows 8.1 installed via Boot Camp problem with keys "@" and " " of the keyboard

    Hello,
    I have a MacBook Pro Retina Maverick in 2013 on which I installed Windows via Boot Camp 8.1.
    The installation went well but when I am running Windows 8.1, I have a problem with "@" and "<" keys on the keyboard.
    When I type the "@" key, I get "<"
    When I type the "<" button, I get "@"
    I have reinstall Boot Camp from Windows 8.1 for reinstall the drivers and see if it would solve the problem but it was not the case.
    Someone of you has he encountered the same problem?
    Thank you.

    The language of my Keyboard is French

Maybe you are looking for