static void addToContainer(final Container a, final Component b) { if (a != null && b != null) swing { a.add(b); } }