How add list(ArrayList) in JFrame? [closed]

﹥>﹥吖頭↗ 提交于 2019-12-13 08:36:29

问题


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 ArrayList to a Vector.
  • 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!