[vtkusers] vtkPanel on osx
Anastasia Mironova
mironova at sci.utah.edu
Mon Jun 26 18:09:38 EDT 2006
Hello,
I am having trouble making a vtkPanel within a javax.swing
JFrame on a MacBook Pro. It works without a single error
message on a linux build... please help.
Here is the code I run:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import vtk.*;
/**
* An application that displays a JButton and several
JRadioButtons.
* The JRadioButtons determine the look and feel used by
the application.
*/
public class SimpleFrame extends JFrame{
private vtkPanel mypanel;
public SimpleFrame() {
super("visualization");
mypanel = new vtkPanel();
mypanel.GetRenderer().SetBackground(1, 1, 1);
vtkConeSource cone = new vtkConeSource();
cone.SetResolution(8);
vtkPolyDataMapper coneMapper = new
vtkPolyDataMapper();
coneMapper.SetInput(cone.GetOutput());
vtkActor coneActor = new vtkActor();
coneActor.SetMapper(coneMapper);
mypanel.GetRenderer().AddActor(coneActor);
getContentPane().add(mypanel, BorderLayout.CENTER);
pack();
}
public static void main(String s[]) {
(new SimpleFrame()).setVisible(true);
}
}
Here are the errors I get:
java SimpleFrame
2006-06-26 16:59:37.445 java[10384] CFLog (0):
CFMessagePort: bootstrap_register(): failed 1103 (0x44f),
port = 0x10503, name = 'java.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error
codes.
2006-06-26 16:59:37.446 java[10384] CFLog (99):
CFMessagePortCreateLocal(): failed to name Mach port
(java.ServiceProvider)
Exception in thread "AWT-AppKit" JavaAWT: Assertion
failure: Java exception thrown
JavaAWT: File
src/macosx/native/apple/awt/util/AWTException.m; Line 40
JavaAWT: Assertion failure: _javaException
JavaAWT: File
src/macosx/native/apple/awt/util/AWTException.m; Line 48
2006-06-26 16:59:41.329 java[10384] Exception raised
during posting of notification. Ignored. exception: See
Java exception object
What happens is that the frame appears and so does the
vtkPanel but it freezes immediately and does not respond
to anything. I would greatly appreciate any advice on how
to fix this.
Sincerely,
-Anastasia
More information about the vtkusers
mailing list