Snippet7 [Java Application]
net.sf.paperclips.examples.Snippet7 at localhost:49285
Thread [main] (Running)
Daemon Thread [Thread-0] (Suspended (exception NullPointerException))
Printer.internal_new_GC(GCData) line: 307
GC.<init>(Drawable, int) line: 169
GC.<init>(Drawable) line: 132
PrintPreview.getGC() line: 507
PrintPreview.fetchPages(int) line: 535
PrintPreview.getPageCount() line: 188
Snippet7$UI.updatePageNumber() line: 440
Snippet7$UI.createShell() line: 103
Snippet7.main(String[]) line: 523
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java (Sep 1, 2009 7:26:39 AM)
This is where the error occurs (high-lighted):
(The 'operation' field is non-null, so it must be the context returned by operation.context() that is null)
public int /*long*/ internal_new_GC(GCData data) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
NSAutoreleasePool pool = null;
if (!NSThread.isMainThread()) pool = (NSAutoreleasePool) new NSAutoreleasePool().alloc().init();
try {
if (data != null) {
if (isGCCreated) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
data.device = this;
data.background = getSystemColor(SWT.COLOR_WHITE).handle;
data.foreground = getSystemColor(SWT.COLOR_BLACK).handle;
data.font = getSystemFont ();
float scaling = scalingFactor();
Point dpi = getDPI (), screenDPI = getIndependentDPI();
NSSize size = printInfo.paperSize();
size.width = (size.width * (dpi.x / screenDPI.x)) / scaling;
size.height = (size.height * dpi.y / screenDPI.y) / scaling;
data.size = size;
isGCCreated = true;
}
return operation.context().id;
} finally {
if (pool != null) pool.release();
}
}