Remove the line cp.setLayout(null)
. This will fix the initial problem.
After that:
- indent the code
- respect Java naming conventions
- don't add panels to the content pane if you add them to the splitpanes right after. A component can be added to a single parent. It doesn't make sense to add them to both
- don't use
setBounds()
. That's the role of the layout manager - don't extend JPanel and JFrame. Use them
- Respect Swing's threading policy.
- Don't
catch (Exception)