How can add a ItemListener to a List

Hello mates,
I m trying to add a ItemListener to a List by :
list.addItemListener((ItemListener) this);
/*other actionListeners*/
list.addActionListener(this);
add.addActionListener(this);
update.addActionListener(this);
delete.addActionListener(this);but got ClassCastException. I extends JFrame in this class. What should I do to solve this problem?
Cheers,
Elton

In JList such method addItemListener doesnt exist. Try using
list.addListSelectionListener(
            new ListSelectionListener()
                public void valueChanged(ListSelectionEvent event)
                   // TODO
        );or if you prefer list.addListSelectionListener(this) your class must implement ListSelectionListener interface.
Hope i've been of some assistance!

Similar Messages

  • How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM.

    How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM. I found that it can be
    done by using XsltListViewWebPart class but how can I use this one by using shraepoint client api.
    shiv

    Nice, can you point me to the solution please ?
    I'm  trying to do this but I get an error : 
    Web Part Error: Cannot complete this action. Please try again. Correlation ID: blablabla
    StackTrace:    at Microsoft.SharePoint.SPViewCollection.EnsureViewSchema(Boolean fullBlownSchema, Boolean bNeedInitallViews)     at Microsoft.SharePoint.SPList.GetView(Guid viewGuid)   
    All help really appreciated.

  • How to add .js link in custom list form through sharepoint designer 2013

    hi friends
    so far i was adding jquery code to script editor webpart in custom list form.
    but i need to know how to add .js link in custom list form through sharepoint designer 2013
    please help me.

    Hi,
    We can add the "JS Link Property" in the “WebPart” node in the custom list form page through SharePoint designer 2013.
    Here is an example for your reference:
    <JSLink xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">~site/Style Library/js/custom.js</JSLink>
    Noticed that, we should not lose the 'xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm' attribute.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • HT201301 how to add app to file sharing list ?

    how to add app to file sharing list ?
    For expamle, i have autocad ws app on iPad. When i had previous version of iTunes i saw this program in file sharing list.
    After upgrading iTunes AutoCad have gone from this list, how can I return this back?
    Thank You.

    From what I read in the app description in iTunes on my computer, you need some sort of account and you use this with a desktop program as well. Files are uploaded to a server???
    I see no mention of file sharing in the app description.
    https://itunes.apple.com/app/autocad-ws/id393149734?mt=8
    BTW, you cannot add an app to file sharing - it has to suppport file sharing on it's own - it must be built into the app. If the app supports file sharing, it will be in the file sharing apps list in iTunes.

  • Does anyone know how to Add a date drop down list to a pdf file?

    Can someone tell me how to add a Date drop down list in a form

    There's no built-in function that does that in Acrobat, but there are some third-party tools that do.
    The two most known ones are by FormRouter, which is free and based on form fields (but also a bit buggy), and a non-free version created by Max Wyss, which is based on a dialog object.

  • One laptop died.  I have a new laptop now.  How can I get my Ipod song list on the new laptop without downloading each c.d.?

    My first laptop died.  I have a new laptop now.  How can I get my Ipod song list on the new laptop without downloading each c.d.?

    See this older post from another forum member Zevoneer covering the different ways to copy content from your iPod to your PC.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • How can I get a drop-down list selection also be selected in another field with the same list but a different name?

    I have a street address and a billing address. A question is posed with a checkbox — "Is the billing address the same as the street address?" If Yes is checked, the street address automatically fills the billing fields. If No is checked, the user must fill in new information. In both the street address and billing addres, the State field is a drop-down list. How can I get the drop-down list selection in the street address State also be selected in drop-down list for the billing address State?

    Has anyone done this?

  • How can I delete the purchased books list in iBook?

    How can I delete the purchased books list in iBook?

    Hi,
    Yes you are miss understanding the problem.  To clarify. The problem is not how to delete the book from a device, it is how to delete the puchase (i.e. the history).  You can hide it in your account settings, but you cannot delete it. So if you buy something on a shared account (i.e. a family account like mine), your children can see and download any of your puchases - forever.
    Some will say it's for your protection.  A bit like the shop looking after your receipt, so that you cannot lose it.
    However, I thought that as part of the data protection act, you could ask for this information kept about you to be deleted, but this doesn't apply to Apple purchases.  Believe me I've tried.

  • How can I delete the recent calls list in FaceTime?

    How can I delete the recent calls list in FaceTime of my Mac?

    Hello muchaim,
    After reviewing your post, it sounds like you want to delete the recent call list. I would recommend that you read this article, it may be able to help the issue.
    FaceTime for Mac (Yosemite): Make and receive FaceTime calls
    FaceTime keeps a list of the most recent calls you made, received, or declined, with the most recent call at the top. To return a call, click the Video button  or the Audio button . To remove a call, select it and press Delete.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • I tried to create a new google calendar in ical, but they did not show up, I tried this several times. Now when I sync my iPad via iTunes all these failed attempts are showing up under the ical sync list in iTunes, how can i clear them from this list?

    I tried to create a new google calendar in ical, but they did not show up, I tried this several times.
    Now when I sync my iPad via iTunes all these failed attempts are showing up under the ical sync list in iTunes, how can I clear them from this list?

    See https://bugs.downthemall.net/ticket/2147
    Google Search Bug
    Reported by: openid:nathan wride Owned by:
    Priority: major Milestone:
    Component: Polish/Usability Version: 2.0.10
    Keywords: Google search instant save bug Cc:
    Operating System: Windows
    Description
    Hi Guys
    I have found a bug/annoying thing that occurs frequently on google. When searching, DTA trys to download the search...
    I'll try to attach a screenshot.
    Attachments
    [https://bugs.downthemall.net/attachment/ticket/2147/Screenshot.png Screenshot.png] Download (113.0 KB) - added by openid:nathan wride 4 weeks ago.
    The screenshot that shows the bug.

  • How can I be certain the contact list in my iPod touch updates my computer Outlook contact list when I sync and not go the other way? The options in iTunes are not specific enough.

    How can I be certain the contact list in my iPod touch updates my computer Outlook contact list when I sync and not go the other way? The options in iTunes are not specific enough. In other words, I want to replace the information in my computer Outlook contact list with the data from my iPod touch. 

    How is your iPod configured to sync music from your iTunes library?  In other words, what options and configurations do you have enabled from under the iPod's Summary and Music configuration panes in iTunes?
    B-rock

  • HT1382 How can I copy over my contact list from my ipod touch 3 to my new ipod touch 5 ?

    How can I copy over my contact list from my ipod touch 3 to my new ipod touch 5 ??

    Sync it with iTunes on your computer.

  • How can i copy and paste the list paragraph?

    I uses the 'Pages' and have a problem to copy text to 'Mail' application from 'Pages'
    The text with list like '1. blarblar' can't copy to other application with list format.
    So the copy result is 'blarblar'. How can i copy the text with list styles?

    I don't think the list style transfers. Copy and paste the text in to Mail, select it and then choose "Insert Numbered List" as a work around.

  • How can i get out the reading list???

    how can i get out the reading list?

    This really needs to be posted in the Safari forum but I will answer it here.
    What do you mean by get out? You want to see the list? Clicking on the pair of glasses controls the display of the list. The glasses are in the gray bookmark bar. Click once to open and click again to close the reading list.

  • How can add captions or title to a picture now that iPhoto doesn't work after updating to iOS 8.

    I Have updated to iOS 8 and iPhoto is dismissed. How can add a caption /title (not in the image) like I was used with iPhoto? Photos has not this feature.
    please, could anyone help me. I'm a real beginner. Thanks,

    I Have updated to iOS 8 and iPhoto is dismissed. How can add a caption /title (not in the image) like I was used with iPhoto? Photos has not this feature.
    please, could anyone help me. I'm a real beginner. Thanks,
    The photos.app does not (yet) have the option to add captions or tags. It is not possible right now. You can however search for the captions you added previously using the search field.  You can also search for album names.  So, as a work-around, put photos that should have the same caption into an album with a name like the caption.
    See:  Migrating from iPhoto for iOS to Photos on iOS 8
    You may want to send feedback to Apple, that captions and tags are essential and need to be added in an update. Use this form:   Apple - iPhoto - Feedback

Maybe you are looking for

  • SUS Background Colour Change

    Hi, My Client's requirement is to change the background colour of SUS Screen. Do anyone have Idea how to change the background colour? Regards, Lovkesh

  • Finder goes white?!?!

    Hi all! In the images below what was happened to my finder window during scrollbar moving. A 'kill -HUP <finder pid>' solve the problem but: what is this? How it happen? http://img233.imageshack.us/img233/2223/immagine1ro1.png http://img402.imageshac

  • Can't download developer edition

    I can't download FMS DE Linux Version. Windows version starts downloading instead (the Flashmedia3_5_Int_Strm_ALP file). Help required urgent! Thanks in advance.

  • Adding Video Editing to existing CS5 - Possible?

    I have adobe photoshop CS5 version 12.1.  Is there any way to add on the video editing component without having to purchase the whole Premiere package?

  • Paste as Background option grayed out

    I'm using Captivate1. When I edit a slide, I select Copy Background, edit it in Paint, copy it from Paint and try to Paste as Background into Captivate. The Paste as Background option is grayed out. It doesn't happen all the time. Sometimes I have to