Reputation: 79
I have a jtable from which I'm picking up which column the user has clicked and showing one jframe respectively
DefaultTableModel model = (DefaultTableModel)Table.getModel();
int col = Table.columnAtPoint(new Point(evt.getX(), evt.getY()));
if (col == 14)
{
new frame2(name).setVisible(true);
}
name
is a string which I'm passing from (current frame) frame1 to a new frame (frame2). This set up works without any problems, just that if i click twice, I see two frame2 opened. Is there a way to disable multiple openings of frame2.
Upvotes: 1
Views: 43
Reputation: 300
Maybe try this:
if (!frame2(name).isVisible()) {
new frame2(name).setVisible(true);
}
Upvotes: 1