Have you tried compiling that? I don't think so, or you'd have found out that "frame.setContentPane( BorderLayout.CENTER);" will not compile. This method takes a Container, not a
String. Don't you mean "frame.setContentPane("jp);"?
Also, "jp.setSize(200,50);" may not work if the parent component's layout manager overrides the size. If the JPanel is your ContentPane I don't think it will cause any problems though.