// c = JComponent or something implementing swing() static JComponent wrap(O swingable) { if (swingable == null) null; JComponent c = cast swingable instanceof JComponent ? swingable : callOpt(swingable, "swing"); if (c instanceof JTable || c instanceof JList || c instanceof JTextArea || c instanceof JEditorPane || c instanceof JTextPane || c instanceof JTree) ret jscroll(c); ret c; }