Javax.media,j3d import problem
Hi,
I had one old project and have tried to run it today.
I have downloaded jdse 1.5 and I have tried to compile with eclipse 3.1 but I can't import these classes, the errors are :
Severity Description Resource In Folder Location Creation Time
2 The import javax.media cannot be resolved Demoirb2000nonrealtime.java RTEnvironment/Demo line 15 8 de diciembre de 2005 10:49:38
2 The import javax.vecmath cannot be resolved Demoirb2000nonrealtime.java RTEnvironment/Demo line 16 8 de diciembre de 2005 10:49:38
2 The import com.sun.j3d cannot be resolved Receiver.java RTEnvironment/Demo line 4 8 de diciembre de 2005 10:39:33
what can I do?
try a search on google for javax.media and the others import I'm not sure but I think they are not standard java.
Similar Messages
-
Hi
i am chnage Java 3d object loader applet background color for run time.
here i attached my coding.
error will be displayed like
javax.media.j3d.CapabilityNotSetException: Background: no capability to set color
pls help me, how to set runtime coor setting option.
regards,
M.Mathivanan- I will say again. Please do not cross post. This is thread #3 for the exact same question. Keep all your questions regarding the same problem in the same thread. You will find the answer you need in the following thread:
http://forum.java.sun.com/thread.jspa?threadID=673593&tstart=0 -
Creating a text with transparent background using javax.media.j3d.Raster
Hi, I'm trying to display a text in Java3D using the Raster but I'm not sure to make the background of the text transparent. Does anyone have any ideas.
Here's my code for creating the Raster image:
private javax.media.j3d.Raster getRaster(String str, boolean rotate) {
// Create an empty raster.
javax.media.j3d.Raster raster = new javax.media.j3d.Raster();
// Get a font metrics.
Font font = new Font("Times", Font.PLAIN, 12);
FontMetrics fm = getFontMetrics(font);
// Calculate the raster size.
int width = SwingUtilities.computeStringWidth(fm, str) + 6;
int height = 18;
// Create an BufferedImage.
BufferedImage image = new BufferedImage(width,
height,
BufferedImage.TYPE_INT_BGR);
// Draw the input string on the BufferedImage.
Graphics2D g2d = (Graphics2D) image.getGraphics();
g2d.setFont(font);
g2d.setColor(Color.WHITE);
g2d.drawString(str, 3, 14);
// Set the BufferedImage to the raster.
raster.setImage(new ImageComponent2D(ImageComponent2D.FORMAT_RGB, image));
raster.setSize(width, height);
raster.setType(javax.media.j3d.Raster.RASTER_COLOR);
raster.setCapability(javax.media.j3d.Raster.ALLOW_IMAGE_WRITE);
raster.setCapability(javax.media.j3d.Raster.ALLOW_SIZE_READ);
return raster;
Thank you for your help.Hi,
If you create a new transparent imge you can put a color fill layer below the text layer and either turn off the layer visiblity for the color fill layer (eye beside the color fill layer in the layers panel)
or delete the color fill layer before saving the file as a transparent png. -
Where is the javax.media.j3d
Hi I install Java3d JDK 1.4.2 but i have only one jar file with com.sun... utility java 3d package what I must do to have package javax.media.j3d?And do I can use java 3d to create games?
Hi I install Java3d JDK 1.4.2 but i have only one jar
file with com.sun... utility java 3d package what I
must do to have package javax.media.j3d?For me it was straight forward process of installing the complete J3D. Extract the files to YOUR_JDK_PATH/jre/lib/ext and/or tell java via the CLASSPATH variable to use the jar's.
And do I can use java 3d to create games?Yes...if you put some brain and effort in it. There are several projects in the web, which care about game programming using J3D. Try to google for them.
Hope this helps.
Kai -
Javax.xml.stream import problem???? plz help
hi, i am looking into using stax to write to xml, however i believe i need some classes contained within javax.xml.stream.*; and this is not contained within j2se docs i know, i think it comes with the web services.
what i wanted to know is as i am using netbeans what is the best way for me to use these packages as i still need the current ones contained within j2se for the rest of my app
thanks
Danny =)do i have to download another jre or can it be done using the one i currently have, j2se 1.9
-
Javax.media.NoPlayerException: Cannot find a Player
Hi all,
I've installed JMF,
and tried the sample 'SimplePlayerApplet.java' from Sun:
http://java.sun.com/products/java-media/jmf/2.1.1/samples/
(see the code below)
However, everytime I run the applet,
I get the message:
"javax.media.NoPlayerException: Cannot find a Player"
Can anybody help?
-------code from sun website-----------------
* @(#)SimplePlayerApplet.java 1.2 01/03/13
* Copyright (c) 1996-2001 Sun Microsystems, Inc. All Rights Reserved.
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.lang.String;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.IOException;
import java.util.Properties;
import javax.media.*;
//import com.sun.media.util.JMFSecurity;
* This is a Java Applet that demonstrates how to create a simple
* media player with a media event listener. It will play the
* media clip right away and continuously loop.
* <!-- Sample HTML
* <applet code=SimplePlayerApplet width=320 height=300>
* <param name=file value="sun.avi">
* </applet>
* -->
public class SimplePlayerApplet extends Applet implements ControllerListener {
// media Player
Player player = null;
// component in which video is playing
Component visualComponent = null;
// controls gain, position, start, stop
Component controlComponent = null;
// displays progress during download
Component progressBar = null;
boolean firstTime = true;
long CachingSize = 0L;
Panel panel = null;
int controlPanelHeight = 0;
int videoWidth = 0;
int videoHeight = 0;
* Read the applet file parameter and create the media
* player.
public void init() {
//$ System.out.println("Applet.init() is called");
setLayout(null);
setBackground(Color.white);
panel = new Panel();
panel.setLayout( null );
add(panel);
panel.setBounds(0, 0, 320, 240);
// input file name from html param
String mediaFile = null;
// URL for our media file
MediaLocator mrl = null;
URL url = null;
// Get the media filename info.
// The applet tag should contain the path to the
// source media file, relative to the html page.
if ((mediaFile = getParameter("FILE")) == null)
Fatal("Invalid media file parameter");
try {
url = new URL(getDocumentBase(), mediaFile);
mediaFile = url.toExternalForm();
} catch (MalformedURLException mue) {
try {
// Create a media locator from the file name
if ((mrl = new MediaLocator(mediaFile)) == null)
Fatal("Can't build URL for " + mediaFile);
try {
JMFSecurity.enablePrivilege.invoke(JMFSecurity.privilegeManager,
JMFSecurity.writePropArgs);
JMFSecurity.enablePrivilege.invoke(JMFSecurity.privilegeManager,
JMFSecurity.readPropArgs);
JMFSecurity.enablePrivilege.invoke(JMFSecurity.privilegeManager,
JMFSecurity.connectArgs);
} catch (Exception e) {}
// Create an instance of a player for this media
try {
player = Manager.createPlayer(mrl);
} catch (NoPlayerException e) {
System.out.println(e);
Fatal("Could not create player for " + mrl);
// Add ourselves as a listener for a player's events
player.addControllerListener(this);
} catch (MalformedURLException e) {
Fatal("Invalid media file URL!");
} catch (IOException e) {
Fatal("IO exception creating player for " + mrl);
// This applet assumes that its start() calls
// player.start(). This causes the player to become
// realized. Once realized, the applet will get
// the visual and control panel components and add
// them to the Applet. These components are not added
// during init() because they are long operations that
// would make us appear unresposive to the user.
* Start media file playback. This function is called the
* first time that the Applet runs and every
* time the user re-enters the page.
public void start() {
//$ System.out.println("Applet.start() is called");
// Call start() to prefetch and start the player.
if (player != null)
player.start();
* Stop media file playback and release resource before
* leaving the page.
public void stop() {
//$ System.out.println("Applet.stop() is called");
if (player != null) {
player.stop();
player.deallocate();
public void destroy() {
//$ System.out.println("Applet.destroy() is called");
player.close();
* This controllerUpdate function must be defined in order to
* implement a ControllerListener interface. This
* function will be called whenever there is a media event
public synchronized void controllerUpdate(ControllerEvent event) {
// If we're getting messages from a dead player,
// just leave
if (player == null)
return;
// When the player is Realized, get the visual
// and control components and add them to the Applet
if (event instanceof RealizeCompleteEvent) {
if (progressBar != null) {
panel.remove(progressBar);
progressBar = null;
int width = 320;
int height = 0;
if (controlComponent == null)
if (( controlComponent =
player.getControlPanelComponent()) != null) {
controlPanelHeight = controlComponent.getPreferredSize().height;
panel.add(controlComponent);
height += controlPanelHeight;
if (visualComponent == null)
if (( visualComponent =
player.getVisualComponent())!= null) {
panel.add(visualComponent);
Dimension videoSize = visualComponent.getPreferredSize();
videoWidth = videoSize.width;
videoHeight = videoSize.height;
width = videoWidth;
height += videoHeight;
visualComponent.setBounds(0, 0, videoWidth, videoHeight);
panel.setBounds(0, 0, width, height);
if (controlComponent != null) {
controlComponent.setBounds(0, videoHeight,
width, controlPanelHeight);
controlComponent.invalidate();
} else if (event instanceof CachingControlEvent) {
if (player.getState() > Controller.Realizing)
return;
// Put a progress bar up when downloading starts,
// take it down when downloading ends.
CachingControlEvent e = (CachingControlEvent) event;
CachingControl cc = e.getCachingControl();
// Add the bar if not already there ...
if (progressBar == null) {
if ((progressBar = cc.getControlComponent()) != null) {
panel.add(progressBar);
panel.setSize(progressBar.getPreferredSize());
validate();
} else if (event instanceof EndOfMediaEvent) {
// We've reached the end of the media; rewind and
// start over
player.setMediaTime(new Time(0));
player.start();
} else if (event instanceof ControllerErrorEvent) {
// Tell TypicalPlayerApplet.start() to call it a day
player = null;
Fatal(((ControllerErrorEvent)event).getMessage());
} else if (event instanceof ControllerClosedEvent) {
panel.removeAll();
void Fatal (String s) {
// Applications will make various choices about what
// to do here. We print a message
System.err.println("FATAL ERROR: " + s);
throw new Error(s); // Invoke the uncaught exception
// handler System.exit() is another
// choice.
}First and most obvious question is, what are you trying to have the applet view? The NoPlayerException generally means that JMF couldn't figure out how to display what you're telling it to display, be that an unknown codec, or unknown media type.
-
Javax.media Where download it?
Hi all.
I've downloaded and create the jmf.jar from jmf-2_1_1e-scsl-bin.
Now I try to compile this:
[cut]
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import javax.media.*;
import javax.media.control.FrameGrabbingControl;
import javax.media.format.VideoFormat;
import javax.media.util.BufferToImage;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
[cut]
but I've this errors:
[cut]
Scan.java [15:1] package javax.media does not exist
import javax.media.*;
^
Scan.java [16:1] package javax.media.control does not exist
import javax.media.control.FrameGrabbingControl;
^
Scan.java [17:1] package javax.media.format does not exist
import javax.media.format.VideoFormat;
^
Scan.java [18:1] package javax.media.util does not exist
import javax.media.util.BufferToImage;
^
4 errors
Errors compiling Scan.
[cut]
So, where I've to download the javax.media pakage?
thank you.
jmaxosft
[cut]Try:
http://java.sun.com/products/java-media/jmf/2.1.1/download.html
Yous should choose cross-platform java and in zip file you have
in directory :src\share\ packet source for javax, copy it to your
project directory and that's it...
I hope it helps... -
Javax.media.CannotRealizeException
package mediaplayer;
import javax.swing.*;
import java.awt.*;
import javax.media.*;
import java.net.*;
public class PlayerFrame extends JFrame
public PlayerFrame() throws Exception
setSize(500, 400);
Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, true);
Player p = Manager.createRealizedPlayer(new URL("http://rds.yahoo.com/_ylt=A0SO8Z0s8ntIvv0AdxX8w8QF;_ylu=X3oDMTA4NDgyNWN0BHNlYwNwcm9m/SIG=12a3nctk9/EXP=1216168876/**http%3a//www.doupe.cz/vaulty/finalfantasy/movies/cnn.avi"));
Component video = p.getVisualComponent();
Component panel = p.getControlPanelComponent();
if(video != null)
add(video);
if(panel != null)
add(panel, BorderLayout.SOUTH);
p.start();
Unable to handle format: DX50, 640x320, FrameRate=29.9, Length=1228800 0 extra bytes
Unable to handle format: mpeglayer3, 24000.0 Hz, 0-bit, Stereo, Unsigned, 8000.0 frame rate, FrameSize=8 bits
Failed to realize: com.sun.media.PlaybackEngine@105bd58
Error: Unable to realize com.sun.media.PlaybackEngine@105bd58
Exception in thread "main" javax.media.CannotRealizeException
at javax.media.Manager.blockingCall(Manager.java:2005)
at javax.media.Manager.createRealizedPlayer(Manager.java:528)
at mediaplayer.PlayerFrame.<init>(PlayerFrame.java:14)
at mediaplayer.Main.main(Main.java:9)The file you are trying to play is in an unsupported format.
Supported formats:
http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html -
Problem to find the javax.media.jai package
hi everyone!! it's not the first time I ask this question, but i have troubles to find javax.media.jai..
I've downloaded the jai 1.1 and everything is fine... However, I have to use classes from the javax.media.jai... I made the import, and it doesn't find it, as if it doesn't exist... Someone tells me that the jai contained it, so why doesn't it find it??
i'm using a java version 1.2.. do you think that is the problem?
thanks a lot, and sorry for my bad english!!
Anne.thanks a lot!!! it helps me but doesn't resolve my problem!! ;o)
you may be right,, it's a classpath problem. well i work under unix, so i have to give my classpath by the command setenv CLASSPATH ...
i didn't find the jai_core.jar in my JAI 1.1, I have only the BugFixes.jar...
I tried to download the latest version of JAI, and unfortunately i have a new problem with the .tar, i don't manage to "open" it... the command
tar xvf [archieve file] gives me some errors!!
so I don't know what I'm gonna do.... I think I'm going to ask someone to send me the package, or the specific classes I need, it would be more easier!!
Thanks
Anne. -
Import javax.media.* is not working
Hi,
I'm new to java and i was trying to create a media player using the javax.media package from the JMF. I installed it using the windows setup and it seemed to install correctly. Testing it with the java.sun.com applet tester worked. The media player is also working...
The only problem is that when i import javax.medis.* it gives me a compiler error:
package javax.media does not exist
my code is as follows:
import java.applet.*;
import java.awt.*;
import java.net.*;
import javax.media.*;
public class PlayerApplet extends Applet {
Player player = null;
public void init() {
setLayout( new BorderLayout() );
String mediaFile = getParameter( "FILE" );
try{
URL mediaURL = new URL( getDocumentBase(), mediaFile );
player = Manager.createRealizedPlayer( mediaURL );
if (player.getVisualComponent() != null)
add("Center", player.getVisualComponent());
if (player.getControlPanelComponent() != null)
add("South", player.getControlPanelComponent());
catch (Exception e){
System.err.println( "Got exception " + e );
public void start() {
player.start();
public void stop() {
player.stop();
player.deallocate();
public void destroy() {
player.close();
} Could someone please help me out here... i've tried all the few probable solutions... but to no avail...Well changing the classpath to the correct one still didn't work.... but i still found the solution.
The Developer Environment that i use is JCreator and it seems it ignores the classpath and has its own settings for the class path... changing this also didn't work.
What worked was copying the Jar files from the JMF2.1.1e installed location into the path of the original classpath -
In compileng time this class not found import javax.media.jai.JA
Hi,
I�m download
jai_imageio-1_0_01-lib-windows-i586
jai_imageio-1_0_01-lib-windows-i586-jdk
jai_imageio-1_0_01-lib-windows-i586-jre
jdk-1_5_0_02-windows-i586-p
in compel time
import com.sun.media.jai.codec.*;
import javax.media.jai.JAI;
The complier gave me error class not found
How can i configured my system
I have Windows XP
[email protected]try compiling like this:
java -cp "." myTest
This is not compiling, here you execute the already
compiled myTest.java file (or it should be already
compiled). To compile you may want to use javac or any
other available compiler.Oops, sorry, I didn't mean compiling.
If you were able to compile ok, you can try running the program by using:
java -cp "." myTest
This usually will solve the problem when your program comples fine but can't find the class when you try to run it. It's almost like the compiler assumes to look in the current directory but the VM (java.exe) doesn't make this assumption. -
JAI installation problem, javax/media/jai/util/ not found?
Hi,
I am trying to use the JAI instllation in executing a class. However, I keep getting the following message.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/jai/util/
I have added some jars from the JAI instllation to my classpath. However, I still get this message.
What jar file do I have to reference so I do not get this message?Even more strange, I deploy it under Unix, there is no problem. The previous one is deployed
under Windowns XP. Anyone has same experience? -
Import javax.mail not found problem
I have downloaded the most recent mail.jar and activation.jar files and have created a library w/in JDev called javamail and have added these jars to that library. I have also included this library in my ViewController Project. The problem I am having is that the following imports statements are not found by JDev:
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
When I open up the mail.jar I can find all of these classes, so why are these imports not being recongnized?
I have also tried import javax.mail.*; to include everthing and this does not work either.
Does anyone have any suggestions on how to trouble shoot this issue?Try to add the J2EE library - which is predefined in JDeveloper- to your project's libraries.
Worked for me. -
How to import javax.media.*
i am doing project on audio ,video transmission over the LAN.
after installing JMF1.2.1, when i run the program i am getting the error
"D:\raghu\amp\audiolabreports\ampcom\AmpCom.java:3: package javax.media does not exist
import javax.media.*;
^
1 error"
please help me out
-raghnath.gHi,
You need to place jmf.jar in your classpath.
-Amol -
Import javax.media?
i have been trying to play a video from a application and i get a bunch of compile errors one is "package javax.media does not exist" because of this im getting 14 other errors, can anyone help me? i just downloaded and installed Java SDK 1.4.2 and i have jdk1.5.0_05 and jre1.5.0_05. so i should be up to date
Well changing the classpath to the correct one still didn't work.... but i still found the solution.
The Developer Environment that i use is JCreator and it seems it ignores the classpath and has its own settings for the class path... changing this also didn't work.
What worked was copying the Jar files from the JMF2.1.1e installed location into the path of the original classpath
Maybe you are looking for
-
I have a large set of product, architecture, and other subject-specific photos, that I'm preparing for a new website; all to be placed in various galleries. For each photo, I want it to have the same background. If I were doing this manually, I woul
-
Hello ! I'm using PCI-DIO32HS in the synchronous burst mode. I use 533Mhz Pentium computer with 128MB memory. I configured the output card so, that the actual PCLK duration is 100ns, which means 10Mhz data transfer. The sample size is 1000000 data po
-
Lately my internet usage is up to the roof. I though somebody was hacking my wireless router so I made it super safe with lots of restrictions. But that didn't stop the download of stuff over my wireless network. When I monitor who or what is using m
-
Finding first and last members of a group set
Is there any example how to use 'first' and 'last' functions in an sql query ? I have tried to execute a query like this on the scott.emp table : select deptno,min(sal),max(sal),first(sal) from emp group by deptno; but I always get this message: ERRO
-
How to make default value for region based on city?
Dear Experts, When city is selected in TRIP or PR05, how to make the default value of city based on region? The standard search help givenfot citydoesnt contain any enhancement point? Pls suggest how to resolve this!!! Thanks In Advance Rgrds, Sravan