Using in eclipse + Canvas3D and SWING

Hi am user of together borland for eclipse but when i want to run my app
it gives error unstatisfied link no jogl found

i have included all jars into my project and put the jogl.jar and dll in the same dir of project as well

what do i need to do more?

Select your .jars files and do Right Click -> Build path -> Add to build path

Um, wouldn’t:

Imply its the native not the jars that are the problem - unsatisfied linking? How are you running your program?

Kev

found the problem
it seems i just put jar with dlls in folder instead of the dlls extracted from the jar
now it is working fine thanks for the help anyway :slight_smile:

can you perhaps answer another small question can i add a canvas to a JPanel in any way? or how can i view somehting inside a Jpanel?

thx for the respons

Just use org.xith3d.render.Canvas3DPanel. This is done for you previously.
Well, this is part of 0.8.0. So be sure to have a recent version.

Qudus

yes i have new version but wasnt aware of that new feature :slight_smile:
cool thx :wink:

is t his canvas3Dpanel and actual canvas3D yet or do you have to add a canvas3D to it?

A Canvas3DPanel creates a Canvas3D on its own.

Please have a look at the release notes of 0.8.0. They are really short and easy to read. You will get a hint of the most important new features of 0.8

Here is a link: http://www.java-gaming.org/forums/index.php?action=dlattach;topic=14194.0;id=496

do you perhaps have small appl which uses a canvas3dpanel? so i can see how this now works? thx

Yes, I do. Take a look at org.xith3d.test.ui.SwingGUIEnvironmentTest. Dig into the method initGUI, it is used there. But you should use the CVS version. I have simplified this test a little. But the version in the release works as well.

The basic usage of Canvas3DPanel is very simple. Treat it like any other Component and add it to another Container like this:


JFrame f = new JFrame("sdfsdfsdf");
f.setLayout(new GridLayout(1, 1));
Canvas3DPanel c3dp = new Canvas3DPanel(); // there are other constructors that could be interesting, too.
f.getContentPane().add(c3dp, null);

Add it to an (Ext)Xith3DEnvironment like this:


ExtXith3DEnvironment env = new ExtXith3DEnvironment();
env.addCanvas(c3dp);

Or add it to a View if you are not using Xith3DEnvironment:


View view = new View();
view.addCanvas3D(c3dp.getCanvas());

Hope this helps.

Qudus

i tried to adjust my code so i took your advise here and pasted it in but i get an error
Exception in thread “main” java.lang.StackOverflowError
at gui.XithView.getCanvas3D(XithView.java:42)

the jar with code can be found here: (I am sorry but my comments are in dutch since i am belgian :wink: )
http://users.skynet.be/fa006997/FourPanelSplitPane.jar

You’re doing View v = new View() but you have a field named view. Shouldn’t you do view = new View(), simply ?

[quote="<MagicSpark.org [ BlueSky ]>,post:11,topic:27787"]
You’re doing View v = new View() but you have a field named view. Shouldn’t you do view = new View(), simply ?
[/quote]
it is basicly the same since the method returns an object of the type View
so that shouldnt be a problem

You missed the super constructor call.

EDIT: You’re extending the Canvas3DPanel class and have you own constructor. Call the constructor of the super class (Canvas3DPanel) and it will be initialized. You should always call a super constructor when extending classes.

you dont have to explicit call the super in the constructor so that is not the problem
i have added it as well and the error remains

Try it this way: (class XithView)


	public Canvas3D getCanvas3D(){
-	    return getCanvas3D();
+          return super.getCanvas();
	}

But you can even directly use the inherited method getCanvas() of the Cavas3DPanel class and leave this whole method. But if you like this method to be named like this…

i just removed the complete method and now it works but when when i want to resize now the dragging is almost directly stopped so i cant resize the panels fluently

Well, I think what you want to say, is that the canvas gets resized when the mouse is released. If this is the case, it is caused by the fact, that the event causing the children of a container component to be resized is fired when the mouse is released. AFAIK this is fixed to the window environment (M$ Windows in your case).

But maybe I misunderstood you.

well i have the same program but with jpanels and that works fine
the panels are dynamicly resized when you drag mouse like you do with a jsplitpane but when the panels are vcanva3Dpanel it gets all lagy and resizing isnt good at all

vcanva3Dpanel??? ;D hmm…

Good to know. I used a Panel and not a JPanel as super class for Canvas3DPanel, because I thought, only this was necessary and I would free the way to use AWT and not Swing.

But I think, nobody actually uses AWT and no Swing. So I can try it with a JPanel and finally switch to it.

thanks for the advice.

Tried it. It’s just the same behaviour with JPanels.

So please describe your symptoms again and with other words. Maybe I get you right this time.