jScrollPane can’t add component
You’re mixing heavy weight (AWT) components with light weight (Swing) components, this is inadvisable as they don’t tend to play well together. JScrollPane contains a JViewPort onto which you can add a child component, AKA the view. (image from the JavaDocs) So the call jScrollPane.getViewport().setLayout(new FlowLayout(FlowLayout.CENTER)); is actually setting the JViewPort‘s layout manager, which really … Read more