Skip to main content

LG3D mouseclickedeventadapter troubles (WIN XP)

2 replies [Last post]
harrynak
Offline
Joined: 2006-10-24

Hello,

I am trying to make a mouseclickevent but i cant get it to work. i am using the following code:

public class Glassypanelen {

Frame3D frame = new Frame3D();
Component3D comp = new Component3D();
Component3D comp2 = new Component3D();

public Glassypanelen() {

ColorCube cube = new ColorCube( 0.02f );
SimpleAppearance app = new SimpleAppearance(0.3f, 0.11f, 0.8f , 1.0f);
GlassyPanel gpanel = new GlassyPanel( 0.1f, 0.1f,0.01f, app );

comp.setMouseEventPropagatable(true);
comp.addListener(
new MousePressedEventAdapter(
new ActionBoolean() {
public void performAction(LgEventSource lgEventSource, boolean b)
{
Visible1();
}
}));
comp2.addChild( cube );
comp2.setTranslation( 0, 0.02f, -0.02f );
comp.addChild( gpanel );
comp.setRotationAxis( 1,0,0 );
comp.setRotationAngle( (float) (-Math.PI *0.35f) );
comp.setCursor( Cursor3D.SMALL_CURSOR );
frame.addChild( comp );
frame.changeEnabled(true);
frame.changeVisible(true);

}
public ActionBoolean Visible1(){
frame.addChild(comp2);
return null;
}
public static void main(String[] args)
{
new Glassypanelen();
}
}

When i start LG3D (version 0.71) the icon is on the bar but when i select it,it shows nothing.

The error log shows:

Oct 25, 2006 1:40:09 PM org.jdesktop.lg3d.utils.action.AppLaunchAction performAction
WARNING: Executing java app in the same JVM: java Glassypanelen
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jdesktop.lg3d.utils.action.AppLaunchAction$1.run(AppLaunchAction.java:65)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NoClassDefFoundError: Glassypanelen$1
at Glassypanelen.(Glassypanelen.java:38)
at Glassypanelen.main(Glassypanelen.java:66)
... 6 more

I would be very gratefull if you can help me.
Thx for your attention.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
harrynak
Offline
Joined: 2006-10-24

Hmmm i am running LG3D by a batchfile i created:

lg3drun.bat

which looks the following:

@echo off

echo making class file!
cd\workspaces\lg3d\LookingG\
javac -cp "c:\lg3d_071\lib\ext\lg3d-core.jar" Glassypanelen.java
echo Making jar file!
jar cmvf Glas.MF Glassypanelen.jar Glassypanelen.class Glas.lgcfg Glassy.png
Copy Jar file!
copy Glassypanelen.jar c:\lg3d_071\ext\app

echo changing dir!
cd\lg3d_071
cd bin

echo hit a key!

pause>nul

echo Start App!

lg3d-dev.bat

I am using eclipse for programming but i cant seem to figure out how to create build.xml. I dont know if u can help me on this, but if so it would be appreciated.

paulby
Offline
Joined: 2003-06-13

Glassypanelen is not in the classpath that lg3d is searching. How are you deploying this example into lg3d ? If you follow the pattern used by the other apps in lg3d-incubator and add your app to the build.xml file of lg3d-incubator it should resolve the problem.