Opened 15 years ago
Closed 14 years ago
#199 closed defect (fixed)
File chooser does not open, exception is thrown
Reported by: | mirschel | Owned by: | mirschel |
---|---|---|---|
Priority: | major | Milestone: | Promot 0.8.5 |
Component: | PromotGuiVizNav | Version: | 0.8.2 |
Severity: | bad | Keywords: | export dialog |
Cc: |
Description
When the file chooser is called, e.g. for export layout in explorer, the following exception is thrown:
java.lang.IndexOutOfBoundsException?: Invalid index java.lang.IndexOutOfBoundsException?: Invalid index at javax.swing.DefaultRowSorter?.convertRowIndexToModel(DefaultRowSorter?.java:497) at sun.swing.FilePane?$SortableListModel?.getElementAt(FilePane?.java:525) at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1337) at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1288) at javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:929) at javax.swing.JList.getCellBounds(JList.java:1600) at javax.swing.JList.ensureIndexIsVisible(JList.java:1116) at sun.swing.FilePane?.ensureIndexIsVisible(FilePane?.java:1514) at sun.swing.FilePane?.ensureFileIsVisible(FilePane?.java:1525) at javax.swing.plaf.metal.MetalFileChooserUI.ensureFileIsVisible(MetalFileChooserUI.java:783) at javax.swing.JFileChooser.ensureFileIsVisible(JFileChooser.java:597) at javax.swing.JFileChooser.setSelectedFile(JFileChooser.java:478) at org.mpg.dcts.promot.viznav.actions.ExportGraphmlAction?.doIt(ExportGraphmlAction?.java:125) at org.mpg.dcts.promot.vizedit.Editor$1$1.run(Editor.java:291)
It seems that some information needed by the file chooser are not present in that moment. Issue should be add to the KnownBugs? list.
Change History (4)
comment:1 Changed 15 years ago by mirschel
- Owner changed from promot to mirschel
- Status changed from new to assigned
comment:2 Changed 15 years ago by mirschel
- Milestone changed from Promot 0.8.3 to Promot 1.0
comment:3 Changed 14 years ago by mirschel
- Milestone changed from Promot 1.0 to Promot 0.8.5
comment:4 Changed 14 years ago by mirschel
- Resolution set to fixed
- Status changed from assigned to closed
Fixed with r9491. The fix is to wrap the creation of the GUI in a SwingUtilities?.invokeLater(). All code that affects the GUI should execute on the Event Dispatch Thread. For example
SwingUtilities?.invokeLater(new Runnable() {
public void run() {
GUI code here.
}
});
Not reproducible. A testcase would be nice.