Error In Import Javax.media.cannotrealizeexception
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up the import javax.media cannot be resolved up vote 0 down vote favorite I am trying to make a media player for a project in java for school and it says that the imports for javax.media cannot be resolved and any help would be appreciated. Below is the code iI have used. Like I said if anybody can help me to figure it out it would be greatly appreciated. import java.awt.BorderLayout; import java.awt.Component; import java.io.IOException; import java.net.URL; import javax.media.CannotRealizeException; import javax.media.Manager; import javax.media.NoPlayerException; import javax.media.Player; import javax.swing.JPanel; public class MediaPlayer
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Eclipse missing imports (javax.media.* and com.sun.media.*) up http://stackoverflow.com/questions/18278754/the-import-javax-media-cannot-be-resolved vote 4 down vote favorite 2 I have this old java applet that i need to debug, yet i have some problems with import. The import javax.media.* cannot be resolved. The import com.sun.media.* cannot be resolved After some research i tried adding this external libs to the project - with no success. sun-jai_codec.jar from http://www.java2s.com/Code/Jar/s/Downloadsunjaicodecjar.htm installed JMF2.1.1e and added the jmf.jar. I had no luck with this... http://stackoverflow.com/questions/16163524/eclipse-missing-imports-javax-media-and-com-sun-media so im asking some one for a little help! java eclipse jmf javax.imageio share|improve this question edited Apr 23 '13 at 7:58 asked Apr 23 '13 at 7:33 no9 2,213165594 1 can you mention what errors you getting? or warnings? –Murali Apr 23 '13 at 7:39 Try refreshing your project and then cleaning it. Sometimes eclipse does not pickup changes in files. Are those two files in your .classpath file ? –nikkatsa Apr 23 '13 at 7:40 Murali .. the errors are abvious (import cannot be resolved) –no9 Apr 23 '13 at 7:44 nikkatsa ... probably not as i downloaded them and just used "Add external JARs". I have tried clean/refresh/rebuild/reopen ... no luck. –no9 Apr 23 '13 at 7:44 never addexternal jars. just create a folder lib in ur project then copy the jars and add it. –Murali Apr 23 '13 at 8:11 add a comment| 2 Answers 2 active oldest votes up vote 5 down vote accepted Just build the path of your project again. Right click on the project and then select build path--->configure build path--->java build path---->libraries select all jars and then remove and then
here for a quick overview of the site Help Center Detailed answers http://stackoverflow.com/questions/13366100/noplayerexception-runtime-error-with-jmf-app to any questions you might have Meta Discuss the workings https://gist.github.com/4072401 and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack error in Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NoPlayerException runtime error with jmf app up vote 1 down vote favorite hello im trying to create a simple video player with jmf. i think error in import my code its ok but when i execute it i get a NoPlayerException. Here is the code of the player: package reproductor; import java.awt.BorderLayout; import java.awt.Component; import java.io.IOException; import java.net.URL; import javax.media.CannotRealizeException; import javax.media.Manager; import javax.media.NoPlayerException; import javax.media.Player; import javax.swing.JPanel; /** * * @author pollyox16 */ public class repropanel extends JPanel{ public repropanel(URL url){ setLayout(new BorderLayout()); Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, true); try{ createRealizedPlayer(). Component video= reproductor.getVisualComponent(); Component controles=reproductor.getControlPanelComponent(); if(video!=null){ add(video,BorderLayout.CENTER); } if (controles!=null){add(controles,BorderLayout.SOUTH);} reproductor.start();//con esto arrancamos el reproductor. } //end try catch(NoPlayerException e3){ System.out.println("player not created"); } catch (CannotRealizeException e){ System.out.println("player not realized"); } catch (IOException e2){ System.out.println("io exception catch"); } } } here is the code of the main application it only creates a JFileChooser and add the url to the player: here is the code of the main application: package reproductor; import java.net.URL; import javax.swing.JFileChooser; import javax.swing.JFrame; /** * * @author pollyox16 */ public class Reproductor{ public static void ma
a GitHub account Sign in Create a gist now Instantly share code, notes, and snippets. Star 0 Fork 0 smorsi/MediaPanel Created Nov 14, 2012 Embed What would you like to do? Embed Embed this gist in your website. Embed Share Copy sharable URL for this gist. Share Clone via HTTPS Clone with Git or checkout with SVN using the repository's web address. HTTPS Learn more about clone URLs Download ZIP Code Revisions 2 Create a media player Raw MediaPanel //MediaPanel.java package mediaPanel; import java.awt.BorderLayout; import java.awt.Component; import java.io.IOException; import java.net.URL; import javax.media.CannotRealizeException; import javax.media.Manager; import javax.media.NoPlayerException; import javax.media.Player; import javax.swing.JPanel; public class MediaPanel extends JPanel { /** * */ private static final long serialVersionUID = 1L; public MediaPanel (URL mediaURL) { setLayout(new BorderLayout()); Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, true); try { Player mediaPlayer=Manager.createRealizedPlayer(mediaURL); Component video= mediaPlayer.getVisualComponent(); Component controls= mediaPlayer.getControlPanelComponent(); if (video!=null) add (video, BorderLayout.CENTER); if (controls !=null) add (controls, BorderLayout.SOUTH); mediaPlayer.start(); } catch (NoPlayerException noPlayerException) { System.err.println("No media player found"); } catch (CannotRealizeException cannotRealizeException) { System.err.println("Could not realize media player"); } catch (IOException iOException) { System.err.println("Error reading from the source"); } } } //MediaTest.Java package mediaPanel; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import javax.swing.JFileChooser; import javax.swing.JFrame; public class MediaTest { public static void main(String[] args) { JFileChooser fileChooser = new JFileChooser(); int result = fileChooser.showOpenDialog(null); if (result== JFileChooser.APPROVE_OPTION) { URL mediaURL= null; try { mediaURL= fileChooser.getSelectedFile().toURI().toURL(); } catch (MalformedURLException malformedURLException) { System.err.println