Reputation: 31
I have an internalframe, i want to create an evenet
private void errorTableMouseClicked(java.awt.event.MouseEvent evt) {
PaneDialog dlg = new PaneDialog(**this**,true);
}
now the PaneDialog is an JDialog, i cant put the constructor "this" cus "this" is InternalFrame so Netbeans shows an error incompatible types, PaneDiaglog can not be converted to Frame, how i call the JDialog in internalframe?
Upvotes: 1
Views: 1065
Reputation: 324118
Maybe you can use one of the JOptionPane.showInternal???(...)
methods since they only need a Component to be specified as the parent.
Or if you want to get the JFrame for the current internal frame then you can use:
Window window = SwingUtilities.windowForComponent(...);
and then cast the window to a JFrame.
Upvotes: 3