As Ray suggested just use JDialogs
s so you can control the modality. Remember JDialog
works just like JFrame
, so if you know how to make a JFrame
, then JDialog
should be easy. But with JDialog
you get to control the modality.
for (File file : files) {
try {
...
HistogramPanel panel = new HistogramPanel(width, counts, height, horizon);
JDialog dialog = new JDialog();
dialog.setModal(false); <---- very important
dialog.setLayout(new BorderLayout());
dialog.add(panel);
dialog.pack();
dialog.setLocationByPlatform(true);
dialog.setVisible(true);
} catch (...)
}