Hej NG!
Når jeg kører min applikation via Eclipses Debugger, stopper den op pga.
en ArrayIndexOutOfBounds exception.
Jeg kan se i Debuggerens output-kronologi, at det drejer sig om mit JTable:
table = new JTable();
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setShowHorizontalLines(true);
table.setShowVerticalLines(false);
table.setPreferredScrollableViewportSize(new Dimension(400, 400));
table.setPreferredSize(table.getPreferredScrollableViewportSize());
table.setBackground(Color.WHITE);
table.addMouseListener(new MouseListener() {
public void mouseClicked(MouseEvent event) {
if (event.getClickCount() >=2 && event.getButton() ==
MouseEvent.BUTTON1) {
tableRowClicked(table.getSelectedRow(), event.getClickCount(),
event.getButton());
}
}
public void mousePressed(MouseEvent arg0) {}
public void mouseReleased(MouseEvent arg0) {}
public void mouseEntered(MouseEvent arg0) {}
public void mouseExited(MouseEvent arg0) {}
});
// ** set up listener for selections of the tables' content
// ** used to en/disable edit trial button along with remove trial button
final ListSelectionModel lsm = table.getSelectionModel();
lsm.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
setEnabledForEditAndRemoveTrialButtons(!lsm.isSelectionEmpty());
}
});
scrollP = new JScrollPane(table,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
tablePanel.add(scrollP, BorderLayout.CENTER);
Ydermer kan jeg se, at kronologien bevæger sig fra JPanel over i
JScrollPane, over i JScrollPane.setColumnHeader, over i
JViewport.getViewPositon, over i JViewport.getView til
JViewport(Container).getComponent(int).
Applikationen kører ganske fint udenfor debuggeren og fortsætter ganske
upåvirket, hvis jeg blot trykker Resume i debuggeren.
Nogen idé om, hvad denne exception skyldes?
Win XP Pro
Eclipse Version: 3.0.2
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)
Hej fra Janus
--
Kids, try this at home:
http://www.legendsrpg.net/index.php?refid=799