aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/org/jdesktop/j3d/examples/objload
diff options
context:
space:
mode:
authorjada <jada@28c7f869-5b4e-e670-f602-82bfaf57f300>2006-02-11 00:55:33 +0000
committerjada <jada@28c7f869-5b4e-e670-f602-82bfaf57f300>2006-02-11 00:55:33 +0000
commit7f2ec5f282081ddc2510dc03d5d625f3e6078833 (patch)
tree4b38f9c6647c31a5bd31f39de2ed7d7723090a15 /src/classes/org/jdesktop/j3d/examples/objload
parentbdf61f929eb2c5ff73be8020719790048972ae7c (diff)
Modified a couple of the examples programs to access data files in the resources directory.
Diffstat (limited to 'src/classes/org/jdesktop/j3d/examples/objload')
-rw-r--r--src/classes/org/jdesktop/j3d/examples/objload/ObjLoad.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/classes/org/jdesktop/j3d/examples/objload/ObjLoad.java b/src/classes/org/jdesktop/j3d/examples/objload/ObjLoad.java
index dd57983..dfe6c13 100644
--- a/src/classes/org/jdesktop/j3d/examples/objload/ObjLoad.java
+++ b/src/classes/org/jdesktop/j3d/examples/objload/ObjLoad.java
@@ -49,8 +49,6 @@ import com.sun.j3d.loaders.ParsingErrorException;
import com.sun.j3d.loaders.IncorrectFormatException;
import com.sun.j3d.loaders.Scene;
import java.applet.Applet;
-import java.awt.*;
-import java.awt.event.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
@@ -60,6 +58,11 @@ import com.sun.j3d.utils.behaviors.vp.*;
import java.net.URL;
import java.net.MalformedURLException;
+
+
+import java.awt.*;
+import org.jdesktop.j3d.examples.Resources;
+
public class ObjLoad extends Applet {
private boolean spin = false;
@@ -159,12 +162,9 @@ public class ObjLoad extends Applet {
public void init() {
if (filename == null) {
// Applet
- try {
- URL path = getCodeBase();
- filename = new URL(path.toString() + "./galleon.obj");
- }
- catch (MalformedURLException e) {
- System.err.println(e);
+ filename = Resources.getResource("resources/geometry/galleon.obj");
+ if (filename == null) {
+ System.err.println("resources/geometry/galleon.obj not found");
System.exit(1);
}
}