MantisBT - VTK
View Issue Details
0007107VTK(No Category)public2008-05-27 11:592016-08-12 09:54
Jerome Robert 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0007107: [VTK JAVA] vtkCanvas with JSplitterPane crash on Windows
- Add 2 vtkCanvas to a JSplitterPane
- vtkCanvas are properly displayed
- Move the split bar
- vtkCanvas are no longer displayed

This only happen on Windows. It does not happen if JSplitterPane.setContinuousLayout(true) is called before. A workaround is to create the vtkCanvas as this:

vtkCanvas toReturn = new vtkCanvas()
{
    @Override
    public void removeNotify(){}
}

Note that I don't understand why this fix the bug and that it's probably not a clean solution.
/** A program to reproduce the bug */

import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JSplitPane;
import javax.swing.WindowConstants;
import vtk.vtkActor;
import vtk.vtkCanvas;

/**
 *
 * @author Jerome Robert
 */
public class BugJSplitter
{
    private static vtkCanvas createCanvas()
    {
        vtkCanvas toReturn = new vtkCanvas();
        
        // see http://www.vtk.org/Bug/view.php?id=6287 [^]
        toReturn.setMinimumSize(new Dimension(0, 0));
        toReturn.setPreferredSize(new Dimension(0, 0));
        
        toReturn.GetRenderer().AddActor(new vtkActor());
        return toReturn;
    }
    
    public static void main(final String[] args)
    {
        JFrame frame = new JFrame();
        frame.setSize(800, 600);
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        JSplitPane pane = new JSplitPane();
        frame.getContentPane().add(pane);
        pane.add(createCanvas(), JSplitPane.BOTTOM);
        pane.add(createCanvas(), JSplitPane.TOP);
        frame.setVisible(true);
    }
}
No tags attached.
Issue History
2008-05-27 11:59Jerome RobertNew Issue
2008-05-27 12:30Jerome RobertNote Added: 0012121
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036978
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved
2016-08-12 09:54Kitware RobotAssigned To => Kitware Robot

Notes
(0012121)
Jerome Robert   
2008-05-27 12:30   
Bug seen in current CVS version
(0036978)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.