I have an app that displays a JPanel which changes it's text depending on which element of a JList a user selects. I create the JLabel, add it to the panel, and after it's created, the labels text is updated via a method using the setText() method.
Here's the relevant code:
when the app first fires up, the scroll pane is created, but doesn't appear, because nothing is selected. But when the user selects something from the list that is too big to fit in the default size of the panel, the scroll pane does not appear. Any idea how I can fix this?
Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.