Java Code Examples for javax.swing.JOptionPane.getRootFrame()

The following are Jave code examples for showing how to use getRootFrame() of the javax.swing.JOptionPane class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: rapidminer   File: ExtendedJFileChooser.java   View Source Code Vote up 5 votes
private static Window getWindowForComponent(Component parentComponent) throws HeadlessException {
	if (parentComponent == null) {
		return JOptionPane.getRootFrame();
	}
	if (parentComponent instanceof Frame || parentComponent instanceof Dialog) {
		return (Window) parentComponent;
	}
	return getWindowForComponent(parentComponent.getParent());
}