Results 1 to 8 of 8

Thread: Refresh A JList

  1. #1
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default Refresh A JList

    Hello, I have a small problem with a program i wrote, my problem is I can't seem to figure out a way to refresh a JList. What I mean by that is I want to be able to add things to the Jlist I have made while the program is running. Thanks for the help.

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Refresh A JList

    Read the JList API and follow the link to the Swing tutorial on "How to Use Lists" where you will find a working example that shows you how to add items to the ListModel.

  3. #3
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default Re: Refresh A JList

    Quote Originally Posted by camickr View Post
    Read the JList API and follow the link to the Swing tutorial on "How to Use Lists" where you will find a working example that shows you how to add items to the ListModel.
    I know i look at that, but I couldn't seem to get it to work.

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Refresh A JList

    The example from the tutorial works fine for me, I don't know why it wouldn't work for you.

  5. #5
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default Re: Refresh A JList

    Quote Originally Posted by camickr View Post
    The example from the tutorial works fine for me, I don't know why it wouldn't work for you.
    I don't know could you show me how you do it?

  6. #6
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Refresh A JList

    I clicked on the link to download the demo code. Then I compiled and executed the code. (I think you also have to comment out the package statement at the beginning of the code).

  7. #7
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default Re: Refresh A JList

    Quote Originally Posted by camickr View Post
    I clicked on the link to download the demo code. Then I compiled and executed the code. (I think you also have to comment out the package statement at the beginning of the code).
    How did you decompile a .jnlp?

  8. #8
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Refresh A JList

    You don't. There is a link that allows you to download the Java source file.

Similar Threads

  1. Link one JList to another JList
    By mib1bee in forum AWT / Swing
    Replies: 1
    Last Post: 12-31-2010, 07:10 PM
  2. Link one JList to another JList
    By mib1bee in forum Advanced Java
    Replies: 1
    Last Post: 12-30-2010, 06:35 PM
  3. Link one JList to another JList
    By mib1bee in forum New To Java
    Replies: 1
    Last Post: 12-30-2010, 06:24 PM
  4. Refresh jList
    By karq in forum New To Java
    Replies: 1
    Last Post: 07-16-2010, 02:58 AM
  5. JList refresh
    By pbaudru in forum AWT / Swing
    Replies: 5
    Last Post: 01-20-2010, 10:24 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •