I want to replace JPanel1 in a JFrame by JPanel2 which contains a JScrollPane on which JPanel1 should be displayed.
Making the JFrame displaying JPanel2 works, but when I use
JPanel2.JScrollPane1.setViewportView(JPanel1)
i end up having nothing displayed on my JScrollPane1. However, adding other components work, e.g.:
JPanel2.JScrollPane1.setViewportView(new JTextField("I need help!"))
Can anyone tell me what I am doing wrong?