Results 1 to 4 of 4
  1. #1
    lcchai is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Question how to check if JList has been updated?

    Hi all, would like to know if there is anyway I could check if JList is being updated so that I can prompt user whether to save the data.

    i m new to java and trying to modify some source, not really sure what the following code does, but i assume its to do with checking if text field, radio button, check box are being updated?
    ...
    jTXT_code.getDocument().addDocumentListener(dirty) ;
    jRB_dollarOffTotal.addActionListener(dirty);
    jCB_showDiscount.addActionListener(dirty);
    ...

    is there some similar ActionListener for JList? so that if items are added or removed from the JList, my program will know to prompt user if they leave the form and did not click on the save button?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: how to check if JList has been updated?

    Read the API for JList and follow the link to the tutorial on How to Use Lists. There you'll find a link to another tutorial page that tells you how to listen for changes in the list content.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: how to check if JList has been updated?

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: how to check if JList has been updated?

    From a PM:
    Quote Originally Posted by lcchai
    Quote Originally Posted by DarrylBurke View Post
    Read the API for JList and follow the link to the tutorial on How to Use Lists. There you'll find a link to another tutorial page that tells you how to listen for changes in the list content.

    db
    sorry, just registered and i have no idea what u r talking abt n where to find it, care to show me the link?
    thank u n sorry for botherin u.
    Please keep the discussion on the forum. Also, please spell words in full. This is a technical forum, not SMS chat.

    Bookmark these:
    Java Platform SE 7
    Java Platform SE 6

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 4
    Last Post: 01-10-2012, 01:05 PM
  2. Value of the node does not get updated!
    By snajalm in forum Advanced Java
    Replies: 1
    Last Post: 10-12-2011, 08:13 AM
  3. Replies: 3
    Last Post: 04-06-2011, 03:48 AM
  4. why my image is not updated ?
    By aneuryzma in forum New To Java
    Replies: 4
    Last Post: 08-15-2008, 12:08 AM

Posting Permissions

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