static void addToWindow(Component c, Component toAdd) { if (toAdd == null) ret; JFrame frame = getFrame(c); Container cp = frame.getContentPane(); new JPanel newCP; newCP.setLayout(new BorderLayout); newCP.add(BorderLayout.CENTER, cp); newCP.add(BorderLayout.SOUTH, toAdd); frame.setContentPane(newCP); // magic combo to actually relayout and repaint frame.revalidate(); frame.repaint(); }