public void setOutputValues(Iterable<?> objects) { if (objects == null) { viewer.setOutputValues(ImmutableList.of()); } else { Iterable<?> nonNulls = Iterables.filter(objects, Predicates.notNull()); viewer.setOutputValues(ImmutableList.copyOf(ImmutableList.copyOf(nonNulls))); } }
public static void main(String[] args) { Frame f = new Frame("Viewer"); Viewer view = new Viewer(); f.addWindowListener(view); f.add(view); f.setSize(300, 300); view.init(); view.start(); f.setVisible(true); }