void () { if (myComponent instanceof JList) movePageUp((JList<?>)myComponent); else if (myComponent instanceof JTable) movePageUp((JTable)myComponent); else throw new IllegalArgumentException("PageUp is not implemented for " + myComponent.getClass()); }