Skip to content
Advertisement

how can I fix my JList? It’s not appearing

The list isn’t showing on the panel, however when I replace panel2.add(new JScrollPane(insuranceplan)) with panel2.add(insuranceplan), I can see the list but I can only select 1 item.

lab9 is a JLable/ insuranceplan is a Jlist / InsurancePlan is a string [];

JavaScript

Advertisement

Answer

Panel 2 seems to used absolute layout (based on your code).

You provide bounds for lab9 and insuranceplan, but not for JScrollPane.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement