Results 1 to 4 of 4
  1. #1
    Aash96 is offline Member
    Join Date
    Dec 2012
    Posts
    26
    Rep Power
    0

    Unhappy How can I add a video to my Netbeans (6.9.1) project?

    How can I add a video to my Netbeans (6.9.1) project?

    I have downloaded the Java Media Framework, I have saved my video in my "src" folder. Now what is a "MediaPanel class"? They say I must run the JMF files and then create a MediaPanel class and use this code:

    Where do I type this code, please be clear, this code goes into the MediaPanel while running the JMF, so how do I get the MediaPanel to type this code? Where is it?

    URL mediaURL = null;
    try
    {
    String location = "src/projectvid.mpg";
    String location1 = location.trim();
    mediaURL = new File(location1).toURL();

    }

    catch(MalformedURLException malformedURLException)
    {
    System.err.println("Could not create URL for the file");
    }
    if(mediaURL != null)
    {
    JFrame mediaTest = new JFrame("My Project");
    mediaTest.setDefaultCloseOperation(JFrame.EXIT_ON_ CLOSE);

    MediaPanel mediaPanel = new MediaPanel(mediaURL);
    mediaTest.add(mediaPanel);
    mediaTest.setSize(1024, 768);
    mediaTest.setBounds(110,0,800,600);
    mediaTest.setVisible(true);
    }
    try
    {
    Thread.sleep(10);
    }
    catch(Exception e)
    {
    System.out.prinln(e.getMessage);
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: How can I add a video to my Netbeans (6.9.1) project?

    Quote Originally Posted by Aash96 View Post
    Now what is a "MediaPanel class"? They say I must run the JMF files and then create a MediaPanel class and use this code
    If you have to ask that, you need to first learn Java before you dive into more advanced projects. You can start here: Trail: Learning the Java Language (The Java™ Tutorials) and pay special heed to the section Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)

    Also, use code tags, not quote tags, for posting code. I see you've been told this earlier: Any ideas/thoughts on making a voting program using the Netbeans IDE 6.0

    Go through these two:
    Guide For New Members
    BB Code List - Java Programming Forum - Learn Java Programming

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Aash96 is offline Member
    Join Date
    Dec 2012
    Posts
    26
    Rep Power
    0

    Default Re: How can I add a video to my Netbeans (6.9.1) project?

    Please man, I just want to add a video!

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: How can I add a video to my Netbeans (6.9.1) project?

    Quote Originally Posted by Aash96 View Post
    Please man, I just want to add a video!
    And in order to do that you need to understand how Java works, which it appears you don't.
    Expecting to be able to hack together a video player without understanding the fundamentals of Java, JMF, Swing, is expecting too much.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Video in netbeans
    By nadissen in forum NetBeans
    Replies: 2
    Last Post: 03-22-2013, 03:49 PM
  2. Project NetBeans
    By arielcandd in forum NetBeans
    Replies: 1
    Last Post: 03-27-2012, 05:02 PM
  3. First EJB Project in NetBeans
    By enzom83 in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 02-08-2011, 10:15 AM
  4. J2ME/Android Video Streaming Project
    By mox27 in forum Forum Lobby
    Replies: 4
    Last Post: 04-06-2009, 08:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •