You appear to have two JScrollPanes involved, scrollPaneApps, which you set a vertical scrollbar policy, which you try to add a component to, but which you never add to the GUI, and scrollPane1, which you don't set a policy, never add components to, but do add to the GUI. Sorry, but this is totally crazy. You need to fix this so that your code makes sense:
- Add the actual JScrollPane that has its vertical scrollbar policy set to the GUI. If it's not added to the GUI, it makes sense that it will never be seen.
- Don't add components directly to the JScrollPane but rather to its JViewport via the
setViewportView(...)
method. Or you can add a component to the JScrollPane constructor which is little more than syntactic sugar for adding it to the viewport. - Avoid null layouts and absolute positioning (avoid
setBounds(...)
). Using these will make your GUI's rigid, ugly, and almost impossible to improve upon later. Never set a JScrollPane's layout as null, for if you do, it will stop working. Completely.