public static void addToPanel(JPanel panel, @Nls String text) {
    final EmptyPane emptyPane = new EmptyPane(text);
    panel.setLayout(new BorderLayout());
    panel.add(emptyPane.getComponent(), BorderLayout.CENTER);
  }
public static void addToPanel(JPanel panel, @Nls String text)