问题
how can I add a list from arraylist from a class created by me to a Jframe window?
回答1:
Here is one (of many) ways.
- Convert the
ArrayListto aVector. - Construct a JList using the Vector.
- Construct a JScrollPane using the JList.
- Construct the
JFrame JFrame.add(JScrollPane).JFrame.pack().
来源:https://stackoverflow.com/questions/8950956/how-add-listarraylist-in-jframe