From: Dale B. <dr...@cs...> - 2003-08-18 16:13:41
|
Hi, I've been trying for a while to use the X11HandleAccess class to retrieve the window handle, but haven't been able to get it to work. The error I'm receiving is: java.lang.NoClassDefFoundError: sun/awt/DrawingSurface at gl4java.jau.awt.motif.X11HandleAccess.achieveData(X11HandleAccess.java:40) at gl4java.jau.awt.motif.X11HandleAccess.getWinHandle(X11HandleAccess.java:73) at TJRemote.TJRemote$MainCanvas.update(TJRemote.java:65) at sun.awt.RepaintArea.paint(RepaintArea.java:169) [...] I'm new to OpenGL in Java, so there may be something I'm just doing wrong, but here's the code, it's pretty straightforward: class TJRemote { static Frame f; public static void main(String[] args) { f = new Frame( "TJRemote" ); f.add("Center", new MainCanvas(500, 500)); f.setLocation(500,30); f.setLayout(new BorderLayout()); f.setSize( 500, 500 ); f.show(); } static class MainCanvas extends GLCanvas { public MainCanvas(int w, int h) { super(w,h); } public void update(Graphics g) { GLContext glc = getGLContext(); if (glc == null) { System.out.println("Null Context"); return; } X11HandleAccess x11 = new X11HandleAccess(); long drawable = x11.getWinHandle( (this), g); System.out.println("drawable: " + drawable); } } } I'm using Sun's Java version 1.4.2 on Redhat 9. Any help would be greatly appreciated. Thanks. -- Dale Beermann University of Virginia bee...@cs... |