Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Monday, June 28, 2004

How to dynamically add a custom component to a JFileChooser dialog

chooser.addAncestorListener(new AncestorListener() {
public void ancestorAdded(AncestorEvent event) {
((JDialog) SwingUtilities.windowForComponent(chooser))
.getContentPane().add(checkBox, BorderLayout.SOUTH);
}
public void ancestorMoved(AncestorEvent event) {}
public void ancestorRemoved(AncestorEvent event) {}
});

0 Comments:

Post a Comment

<< Home