List of usage examples for javax.swing SwingUtilities getUnwrappedParent
public static Container getUnwrappedParent(Component component)
From source file:pipeline.GUI_utils.ListOfPointsView.java
private static JViewport getTableViewPort(JTable table) { Container parent = SwingUtilities.getUnwrappedParent(table); if (parent instanceof JViewport) { JViewport port = (JViewport) parent; Container gp = port.getParent(); if (gp instanceof JScrollPane) { JScrollPane scrollPane = (JScrollPane) gp; // Make certain we are the viewPort's view and not, for // example, the rowHeaderView of the scrollPane - // an implementor of fixed columns might do this. JViewport viewPort = scrollPane.getViewport(); if (viewPort == null || SwingUtilities.getUnwrappedView(viewPort) != table) { return null; }//from w w w . j a v a2 s . c o m return viewPort; } } return null; }