473,513 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot Resolve Symbol

1 New Member
Hii..i use the coding as below :-

import java.applet.applet;
import java.awt.*;
import com.sun.j3d.utils.applet.mainframe;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;

public class J3DLinesPoints extends Applet {
private SimpleUniverse u=null;

public BranchGroup createScene() {
BranchGroup objRoot = new BranchGroup();
TransformGroup tg = new TransformGroup();
Shape3D shapeLine = new Shape3D();
Transform3D t3d2 = new Transform3D();

PointArray pa = new PointArray(2,PointArray.COORDINATES | pOINTaRRAY.color_3);
LineArray la= new LineArray(2,LineArray.COORDINATES |LineArray.cOLOR_3);
Point3d[] ptsPoints = new Point3d[2];
Point3d[] ptsLine = new Point3d[2];
PointAttributes ptAtt = new PointAttributes();
Color3f[] colors = new Color3f[2];
Appearance appPoint = new Appearance();
t3d2.setscale(0.2);
tg.setTransform(t3d2);
objRoot.addChild(tg);

ptsPoints[0] = new Point3d(2,3,-2);
ptsPoints[1] = new Point3d(2,4,-2);
ptsLine[0] = new Point3d(1,1,-2);
ptsLine[1] = new Point3d(-2,2,-2);

colors[0] = new Color3f(1.0f,0.0f, 0.0f); //red
colors[1] = new color3f(0.0f,0.0f, 1.0f); //blue

pa.setCoordinates(0,ptsPoints); //set the coordinates of the points into the Point Array
pa.setColors(0,colors);
ptAtt.setPointSize(5.0f); //increase size of points to make them more visible
appPoint.setPOintAttributes(ptAtt);
shapePOint.setGeometry(pa);
shapePoint.setAppearance(appPoint);

la.setCoordinates(0,ptsLine); //set the coordinates of the line points into the LineArray
la.setColors(0,colors);
shapeLine.setGeometry(la);

tg.addChild(shapePoint);
tg.addChild(shapeLine);
objRoot.compile();
return objRoot;
}

public void init() {
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas = new Canvas3D(config);
canvas.setBackground(Color.yellow);
add("Center", canvas);
BranchGroup Scene= createScene();
u = new SimpleUniverse (canvas);
u.getViewingPlatform().setNominalViewingTransform( );
u.addBranchGraph(scene);
}

public static void main(String[] args) {
new MainFrame(new J3DLinesPoints(),500,400);
}
}


and the errors which i get in COMMAND prompt are as follows :-

U:\cadcam\java>javac J3DLinesPoints.java
J3DLinesPoints.java:1: cannot resolve symbol
symbol : class applet
location: package applet
import java.applet.applet;
^
J3DLinesPoints.java:3: cannot resolve symbol
symbol : class mainframe
location: package applet
import com.sun.j3d.utils.applet.mainframe;
^
J3DLinesPoints.java:9: cannot resolve symbol
symbol : class Applet
location: class J3DLinesPoints
public class J3DLinesPoints extends Applet {
^
J3DLinesPoints.java:18: cannot resolve symbol
symbol : variable pOINTaRRAY
location: class J3DLinesPoints
PointArray pa = new PointArray(2,PointArray.COORDINATES
| pOINTaRRAY.color_3);

^
J3DLinesPoints.java:19: cannot resolve symbol
symbol : variable cOLOR_3
location: class javax.media.j3d.LineArray
LineArray la= new LineArray(2,LineArray.COORDINATES |Lin
eArray.cOLOR_3);

^
J3DLinesPoints.java:25: cannot resolve symbol
symbol : method setscale (double)
location: class javax.media.j3d.Transform3D
t3d2.setscale(0.2);
^
J3DLinesPoints.java:35: cannot resolve symbol
symbol : class color3f
location: class J3DLinesPoints
colors[1] = new color3f(0.0f,0.0f, 1.0f); //blue
^
J3DLinesPoints.java:40: cannot resolve symbol
symbol : method setPOintAttributes (javax.media.j3d.PointAttributes)
location: class javax.media.j3d.Appearance
appPoint.setPOintAttributes(ptAtt);
^
J3DLinesPoints.java:41: cannot resolve symbol
symbol : variable shapePOint
location: class J3DLinesPoints
shapePOint.setGeometry(pa);
^
J3DLinesPoints.java:42: cannot resolve symbol
symbol : variable shapePoint
location: class J3DLinesPoints
shapePoint.setAppearance(appPoint);
^
J3DLinesPoints.java:48: cannot resolve symbol
symbol : variable shapePoint
location: class J3DLinesPoints
tg.addChild(shapePoint);
^
J3DLinesPoints.java:55: cannot resolve symbol
symbol : method setLayout (java.awt.BorderLayout)
location: class J3DLinesPoints
setLayout(new BorderLayout());
^
J3DLinesPoints.java:59: cannot resolve symbol
symbol : method add (java.lang.String,javax.media.j3d.Canvas3D)
location: class J3DLinesPoints
add("Center", canvas);
^
J3DLinesPoints.java:63: cannot resolve symbol
symbol : variable scene
location: class J3DLinesPoints
u.addBranchGraph(scene);
^
J3DLinesPoints.java:67: cannot resolve symbol
symbol : class MainFrame
location: class J3DLinesPoints
new MainFrame(new J3DLinesPoints(),500,400);
^
15 errors

I am very new..to this java programming so please if you can give me some detailed explannations for the answers.

I refer few blogs on the site for the same error which suggests to give CLASS PATH along with the "javac" command....i tried that too..
but i was not able to do that...

thank you
vishal patel
Oct 19 '06 #1
1 4610
r035198x
13,262 MVP
Hii..i use the coding as below :-

import java.applet.applet;
import java.awt.*;
import com.sun.j3d.utils.applet.mainframe;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;

public class J3DLinesPoints extends Applet {
private SimpleUniverse u=null;

public BranchGroup createScene() {
BranchGroup objRoot = new BranchGroup();
TransformGroup tg = new TransformGroup();
Shape3D shapeLine = new Shape3D();
Transform3D t3d2 = new Transform3D();

PointArray pa = new PointArray(2,PointArray.COORDINATES | pOINTaRRAY.color_3);
LineArray la= new LineArray(2,LineArray.COORDINATES |LineArray.cOLOR_3);
Point3d[] ptsPoints = new Point3d[2];
Point3d[] ptsLine = new Point3d[2];
PointAttributes ptAtt = new PointAttributes();
Color3f[] colors = new Color3f[2];
Appearance appPoint = new Appearance();
t3d2.setscale(0.2);
tg.setTransform(t3d2);
objRoot.addChild(tg);

ptsPoints[0] = new Point3d(2,3,-2);
ptsPoints[1] = new Point3d(2,4,-2);
ptsLine[0] = new Point3d(1,1,-2);
ptsLine[1] = new Point3d(-2,2,-2);

colors[0] = new Color3f(1.0f,0.0f, 0.0f); //red
colors[1] = new color3f(0.0f,0.0f, 1.0f); //blue

pa.setCoordinates(0,ptsPoints); //set the coordinates of the points into the Point Array
pa.setColors(0,colors);
ptAtt.setPointSize(5.0f); //increase size of points to make them more visible
appPoint.setPOintAttributes(ptAtt);
shapePOint.setGeometry(pa);
shapePoint.setAppearance(appPoint);

la.setCoordinates(0,ptsLine); //set the coordinates of the line points into the LineArray
la.setColors(0,colors);
shapeLine.setGeometry(la);

tg.addChild(shapePoint);
tg.addChild(shapeLine);
objRoot.compile();
return objRoot;
}

public void init() {
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas = new Canvas3D(config);
canvas.setBackground(Color.yellow);
add("Center", canvas);
BranchGroup Scene= createScene();
u = new SimpleUniverse (canvas);
u.getViewingPlatform().setNominalViewingTransform( );
u.addBranchGraph(scene);
}

public static void main(String[] args) {
new MainFrame(new J3DLinesPoints(),500,400);
}
}


and the errors which i get in COMMAND prompt are as follows :-

U:\cadcam\java>javac J3DLinesPoints.java
J3DLinesPoints.java:1: cannot resolve symbol
symbol : class applet
location: package applet
import java.applet.applet;
^
J3DLinesPoints.java:3: cannot resolve symbol
symbol : class mainframe
location: package applet
import com.sun.j3d.utils.applet.mainframe;
^
J3DLinesPoints.java:9: cannot resolve symbol
symbol : class Applet
location: class J3DLinesPoints
public class J3DLinesPoints extends Applet {
^
J3DLinesPoints.java:18: cannot resolve symbol
symbol : variable pOINTaRRAY
location: class J3DLinesPoints
PointArray pa = new PointArray(2,PointArray.COORDINATES
| pOINTaRRAY.color_3);

^
J3DLinesPoints.java:19: cannot resolve symbol
symbol : variable cOLOR_3
location: class javax.media.j3d.LineArray
LineArray la= new LineArray(2,LineArray.COORDINATES |Lin
eArray.cOLOR_3);

^
J3DLinesPoints.java:25: cannot resolve symbol
symbol : method setscale (double)
location: class javax.media.j3d.Transform3D
t3d2.setscale(0.2);
^
J3DLinesPoints.java:35: cannot resolve symbol
symbol : class color3f
location: class J3DLinesPoints
colors[1] = new color3f(0.0f,0.0f, 1.0f); //blue
^
J3DLinesPoints.java:40: cannot resolve symbol
symbol : method setPOintAttributes (javax.media.j3d.PointAttributes)
location: class javax.media.j3d.Appearance
appPoint.setPOintAttributes(ptAtt);
^
J3DLinesPoints.java:41: cannot resolve symbol
symbol : variable shapePOint
location: class J3DLinesPoints
shapePOint.setGeometry(pa);
^
J3DLinesPoints.java:42: cannot resolve symbol
symbol : variable shapePoint
location: class J3DLinesPoints
shapePoint.setAppearance(appPoint);
^
J3DLinesPoints.java:48: cannot resolve symbol
symbol : variable shapePoint
location: class J3DLinesPoints
tg.addChild(shapePoint);
^
J3DLinesPoints.java:55: cannot resolve symbol
symbol : method setLayout (java.awt.BorderLayout)
location: class J3DLinesPoints
setLayout(new BorderLayout());
^
J3DLinesPoints.java:59: cannot resolve symbol
symbol : method add (java.lang.String,javax.media.j3d.Canvas3D)
location: class J3DLinesPoints
add("Center", canvas);
^
J3DLinesPoints.java:63: cannot resolve symbol
symbol : variable scene
location: class J3DLinesPoints
u.addBranchGraph(scene);
^
J3DLinesPoints.java:67: cannot resolve symbol
symbol : class MainFrame
location: class J3DLinesPoints
new MainFrame(new J3DLinesPoints(),500,400);
^
15 errors

I am very new..to this java programming so please if you can give me some detailed explannations for the answers.

I refer few blogs on the site for the same error which suggests to give CLASS PATH along with the "javac" command....i tried that too..
but i was not able to do that...

thank you
vishal patel
Java is case sensitive. Class names in you program are starting with uppercase but your import statements are importing classes with all lowercase.
change your imports to
import com.sun.j3d.utils.applet.Mainframe;
import java.applet.Applet;
Only then can we tell whether your class path is wrong or not.
Oct 19 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
27760
by: Java script Dude | last post by:
I am investigating a solution to build all pages sent from my application servlet in UTF-8 encoding. From what I understand, I should be using HttpServletResponse.setCharacterEncoding("UTF-8"). The...
1
6383
by: yanwan | last post by:
I met this problem in executing a c++ project in visual studio. Does anyone have suggestions to resolve "error lnk 2001"? --------------------Configuration: reconstruction - Win32...
1
24788
by: Tony Johansson | last post by:
Hello! I get compile error when compiling using the command javac from the command terminal window(CMD). I have just two classes which are called HelloWorld.java and Slask.java. I have both...
2
2781
by: SDyke | last post by:
import com.ibm.as400.ui.framework.java.*; import java.awt.Frame; public class SampleApplication { public static void main(String args) { // Instantiate the bean object that...
3
2341
by: toish | last post by:
I have a program, aaa.java which creates an instance of another class(bbb.java). both java files are in a package entitled 'diss' bbb.java compiles sucessfully aaa.java throws a cannot resolve...
3
2351
by: adamrace | last post by:
Hi, i am fairly new to java and have been stuck on this for ages, basically i need to create a new object which gets a list of data from a text file, so i have this import java.io.*; ...
15
6415
by: Seral1969 | last post by:
Hi, I'm new to Java... I've been trying to get one of my professor's examples to work... He says that the code is fine, but I keep getting 4 "cannot resolve symbol" errors when I try to compile...
7
4074
by: Spectrum | last post by:
I am writing some Python code using the Message Passing Interface (MPI), an API used in parallel computing. There exist a number of Python implementations of MPI, but apparently they all rely on...
3
3167
by: Sindhu Rani | last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do??? C:\s\source>javac -d ..\classes devtestdrive.java devtestdrive.java:5: cannot resolve symbol...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7527
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
1597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.