Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. JList

JList

Scheduled Pinned Locked Moved Java
question
2 Posts 2 Posters 12 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 3512
    wrote on last edited by
    #1

    I wish to add items to a JList after it has been constructed. I can do this: Stringp[] strArray ={"Jack", "Jill", "Mary"); JList peopleList = new JList(strArray); But now how do I added more names to the list????

    D 1 Reply Last reply
    0
    • U User 3512

      I wish to add items to a JList after it has been constructed. I can do this: Stringp[] strArray ={"Jack", "Jill", "Mary"); JList peopleList = new JList(strArray); But now how do I added more names to the list????

      D Offline
      D Offline
      Dave Drake
      wrote on last edited by
      #2

      DefaultListModel dlm = new DefaultListModel(); JList list = new JList(dlm); dlm.add("Jack"); dlm.add("Jill"); dlm.add("Mary"); . . . Hope this helps...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups