From fbe5e85e6017d757ae97a897690b31e897242b38 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 10 Sep 2010 22:03:49 +0200 Subject: exception reporter for CLInfo. --- src/com/jogamp/opencl/demos/info/CLInfo.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/com/jogamp/opencl/demos/info/CLInfo.java') diff --git a/src/com/jogamp/opencl/demos/info/CLInfo.java b/src/com/jogamp/opencl/demos/info/CLInfo.java index af7e30c..0975f7b 100644 --- a/src/com/jogamp/opencl/demos/info/CLInfo.java +++ b/src/com/jogamp/opencl/demos/info/CLInfo.java @@ -4,24 +4,43 @@ package com.jogamp.opencl.demos.info; +import com.jogamp.common.JogampRuntimeException; import com.jogamp.opencl.CLDevice; import com.jogamp.opencl.CLPlatform; +import com.jogamp.opencl.util.ExceptionReporter; import java.awt.Container; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JScrollPane; +import javax.swing.UIManager; /** - * + * Displays OpenCL information in a table. * @author Michael Bien */ public class CLInfo { public static void main(String[] args) { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception ex) { + Logger.getLogger(CLInfo.class.getName()).log(Level.INFO, null, ex); + } + + try{ + CLPlatform.initialize(); + }catch(JogampRuntimeException ex) { + Logger.getLogger(CLInfo.class.getName()).log(Level.SEVERE, null, ex); + ExceptionReporter.appear("I tried hard but I really can't initialize JOCL. Is OpenCL properly set up?", ex); + return; + } + JFrame frame = new JFrame("OpenCL Info"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); Container contentPane = frame.getContentPane(); -- cgit v1.2.3