Getting information about an object from JList

Hi
I have created a movie application and i have a JList displaying all registered movies, it uses a DefaultListModel to display these.
I want to be able to click on an element in the JList and then push a button called "Show movie details" to display all information about the selected movie.'.
Every new movie is added to the DefaultListModel as an object with "Titlle", "Genere" etc. If someone click on a movie, what do i do to get information about which object that was clicked. All i can see is that integers can be returned with the getSelectedIndex/Value methods. If i use one of these methods to get the object from the DefaultListModel, that would work i guess, but what when someone deletes a movie in the middle of the JList, then the indexes wouldnt match.
Can someone help me out here? :)

I get a big fat exception when trying to cast the returned object to a Movie object which im using.
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.S
tring cannot be cast to Movie
...sure that this is the way to do it? If so, what am i doing wrong..

Similar Messages

  • Get information about business object from view implementation class

    Hi,
    i´d like to develop some button behavior in a view. How can i get the information of the related business object like the order or the position. I like to disable buttons if specific status are set.
    Bye Richard

    hi,
    Is needed field available in context nodes or not?
    for example:
    If you want to read STATUS_DESCR attribute from the context node SELECTEDDOC , then code like this
    lr_selected ?=  me->typed_context->SELECTEDDOC->collection_wrapper->get_current( ).
    if lr_selected is bound.
      lv_status = lr_selected->get_property_as_string( 'STATUS_DESCR' ).
    endif.
    activtae the debugging in IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS method and check the values for context nodes and attributes.
    I mean debugging for:
    me->typed_context
    me->typed_context->SELECTEDDOC
    comp_controller
    regards
    ismail

  • Can I get information about client DNS from GSS?

    Can I get information about the client's DNS request and which Data Center was choosed for this request? How long these informations are stored in GSS? Can I change this settings?
    Thank you.

    Following link will give you good start
    http://www.cisco.com/application/pdf/en/us/guest/netsol/ns378/c649/cdccont_0900aecd80122a78.pdf
    Its a two year old document but gives a good overview.
    For details visit
    http://www.cisco.com/en/US/products/hw/contnetw/ps4162/tsd_products_support_configure.html
    Syed

  • A way to get information about colored points from a graph?

    Two questions:
    1. Is there a possibility to know whether a specific point is already plotted in a graph and what is the color of that specific point?
    2. Is there a way to use the legend in order to show what each colored point represents (not lines, only colored points..)?
    Thank you!

    1. I used PlotPoint & a function "returncolor" in order to make each colored point present a different situation depend on variable 'x':
    double m_abs (double x) {
    if (x < 0) return -x;
    return x;
    int returncolor (double x) {
    if (m_abs(x) <= 0.05) return VAL_GREEN;
    if (m_abs(x) <= 0.15 && m_abs(x) > 0.05) return VAL_BLUE;
    if (m_abs(x) <= 0.25 && m_abs(x) > 0.15) return VAL_DK_MAGENTA;
    return VAL_RED;
    The problem occurs when PlotPoint used twice for the exact same point with different colors so only the last colored point would remain.
    I want that in this case, only the color with the maximum variable 'x': would remain..
    Sם I can solve it by saving the data to 2D array.. but I thought maybe there is an option to get true or false whether a point exist on a specific location in a graph or not, and what is the color of that point.
    2. Yes, I have already used annotations., but too bad there is no way to put legend for colored points..

  • Howto get information about Java Stored Procedures programmaticly

    Hi all,
    using the DatabaseMetaData object it is easily possible to get information about database objects like tables, columns or even plsql stored procedures.
    But is there a way to get information about Java Stored Procedures which are published in packages ? Is it possible here to use a DatabaseMetaData object or is there any other solution ?
    TIA,
    Chris

    What sort of information do you want to know about the Java stored procedures?
    Would the views USER_SOURCE or USER_OBJECTS contain the information you need?

  • Within redbox I can not click on a movie and get information about it, instead I get an error message that says that the situation may be temporary. yet i keep having the same problem. Do you have any idea how to fix the problem?

    Within redbox I can not click on a movie and get information about it, instead I get an error message that says that the situation may be temporary. yet i keep having the same problem. Do you have any idea how to fix the problem?

    Did you delete all receipts with iDVD in the file name  with either a .PKG or .BOM extension that reside in the HD/Library/Receipts folder and from the /var/db/receipts/  folder before installing the new copy?  If not then do so and delete the new application also.
    Click to view full size
    Then install iPhoto from the disk it came on originally and apply all necessary updaters: Apple - Support - Downloads
    OT

  • HOW TO GET INFORMATION ABOUT THE CLIENT MACHINE AT DATABASE LEVEL

    HOW TO GET INFORMATION ABOUT THE CLIENT MACHINE AT DATABASE LEVEL USING 10g Database and 10g Application Server
    we have developed an application using oracle forms 10g with
    oracle database 10g and Application server 10g
    Application uses a single Oracle User name to connect to database
    where as at Application level there are different users (these are not database users)
    Now how can we get the information about the user/his machine etc. at database level. earlier in 6i/8i we use to get by using
    USERENV('TERMINAL')
    we had written a triggers on tables on Insert/Update where we used to update a database field Last user terminal with USERENV('TERMINAL')
    but not this information is comming to be the machine name of application server where as we wish this to be the machine name of Client. Any Way outs
    thanks
    Chaand Kackria

    hi, you can use the sys_context function, like this:
    select sys_context('userenv','current_user'),
         sys_context('userenv','os_user'),
         sys_context('userenv','host'),
         sys_context('userenv','ip_address'),
         sys_context('userenv','instance'),
         sys_context('userenv','sessionid'),
         sys_context('userenv','terminal')
    from dual;
    Is this what you 're looking for?

  • PDF DOM - getting information about underlining

    Hi, I‘m trying to prepare PDF documents for blind users. For this I have to extract the visual information of the text and there font style.
    And this is my problem:
    I read the PDF document through the Acrobat or Adobe-Reader application via UI-Automation, Microsoft Active Accessibility and the Adobe intern Accessibility library to access the PDDom.
    In all these different way there is no way (that I found) to getting information about if a word is underlined or not.
    Did anybody know a way to do this, or is it impossible to get information about that?
    Thank u for your interest in my post and for all the helping ideas that will be posted.
    J

    select prv_value from ctx_user_preference_values where prv_attribute='PATH'
    and prv_preference='MY_PREFERENCE_NAME'
    But note that you'll need to rebuild the index before this will take effect.

  • How to get information about limitation Internal Memory on device

    hallo ..
    have some question here, so please some person able to answer my questions 
    1. How to get Information about limitation internal memory on device 
    2. is possible to improve internal memory on Blackberry ( move apps on external memory )
    3. any tools to get internal memory activity ?
    thanks for this people who joins here, hope we can share more information about blackberry .. 

    In addition...
    There are three types of potential memory on a BB: 1) Application Memory, 2) Device Memory, and 3) Media/SD Card Memory.
    Application Memory -- This is the most crucial; it is the protected (not user accessible), dedicated, and fixed (in size) space that is available as the destination for the installation of applications (plus some application storage, overhead and such). You cannot touch AppMemory. You cannot improve the maximum AppMemory that your BB has. It is what it is. Applications can only install here...there is no option.
    Device Memory -- This is space on your BB that you can touch to store files, pictures, media, etc. Typically, it is not terribly large, but it is available to you.
    SD/Media Card Memory-- This is what it says...your SD card, for you to store files, media, pictures, etc. It can be as large as your BB OS can support...see this KB:
    KB05461MicroSD card sizes supported by the BlackBerry device software
    On some devices/OS levels, you can only see "File Free" (Options > Status), which I think is equivalent to AppMemory. On other devices, you can see all three memory usage levels (Options > Memory). Here are some guidelines to use:
    KB02843What is the Low Memory Manager feature on the BlackBerry smartphone
    KB14320How to maximize free space and battery power on the BlackBerry smartphone
    KB14213Call logs, SMS text messages, and email messages are deleted from the BlackBerry smartphone
    Lastly, it is always important to properly close applications when you are done with them. Using the Back or the Red key will not do this -- those leave it to the app to decide what to do...and some will leave themselves resident in memory, consuming resources on your BB, slowing the overall performance. Rather, to close an app, press and select "Close" or "Exit"...that will force the application to be closed, freeing up for your new use the resources it was consuming. Some apps will always remain running (typically -- BBMessenger, Browser, Homescreen, Phone, and Messages)...but, you should still close them properly - especially the Browser...if it is left on an active web page, it will not only consume extra resources but battery power as well.
    Further, anytime random strange behavior or sluggishness creeps in, the first thing to do is a battery pop reboot. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes. See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure. Some have taken to doing this on a regular basis as a preventive measure...some as frequently as once per day. Others have obtained the QuickPull app to automate a simulated Batt-Pull.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Gettting information about the processInstance from BPMObject

    To have our businesslogic manageable, we decided to make use of BPMObjects to more clearly define separation of concerns. However, we still need to be able to access information about the processInstance from the BPMObject. I am able to get information about the activity that invoked the bpmObject, and i am also able to get hold of the process id and name. But I havent been successful in getting the actual instanceId.
    I tried Fuego.Lib.ProcessInstance.id.id, but that will only work from an activity, not a BPMObject.
    BR
    Peter Elfström

    To have our businesslogic manageable, we decided to make use of BPMObjects to more clearly define separation of concerns. However, we still need to be able to access information about the processInstance from the BPMObject. I am able to get information about the activity that invoked the bpmObject, and i am also able to get hold of the process id and name. But I havent been successful in getting the actual instanceId.
    I tried Fuego.Lib.ProcessInstance.id.id, but that will only work from an activity, not a BPMObject.
    BR
    Peter Elfström

  • How do I get information about filing a claim for kids purchases

    How can I get information about making a claim for kids unauthorized purchase?

    I have seen nothing formal from Apple though I have read they are open to discussions about the matter.
    If it is an individual instance, there is a  section on the purchase receipt that invites you to report a problem   Report the purchase and the circumstances.
    However, if it is a recurring problem you would have been expected to utilize the parental control features.

  • Get information about xlate

    Hello all!
    I need take information about NAT configuration from ASA5520 using SNMP.
    Could you help me? Is it possible? If yes how can I do it?
    Thanks

    hi,
    i'm not sure how to do it via SNMP but you could simply execute show xlate and show nat or show nat detail to get the info on your ASA.

  • How do I get information about new legal requirements?

    Hi
    We are 4 people in a company that has 39 active company codes in about 25 countries. How can we subcribe to whenever SAP releases new reports that meets legal requirements in specific countries? Some of our companys have their bookkeeping taken care by a neighboring country, so the bookkeepers would not know if there is a new report released from SAP. So how can we get information about new reports without having to read throug all the release documentation?
    Hope you can help
    Jens Bald
    IC Companys
    Denmark

    Hello Jens,
    this is a real problem.
    What is my experience? The first priority is: try to use the SAP Standard as far as possible. No user-defined reports, no exits. Try to be always up to date with hotpackages.
    A further help for me are the userforums here. If you have five minutes left, just have a look at all the questions and answers.
    I know, there is a lot of stuff to read, but the releasenotes have to be checked. Unhappily I didn't find another way.
    Sometimes SAP reacts just in time regarding new legal requests - and I can understand this. At least I have to say: It is not possible to manage this without having any support from the accountancy side. This enables you to search for this requests - instead of reacting.
    If a country changes statutory requests regarding taxreporting or new taxtypes, changing of rates the guys from local accountancy ought give you a hint. Because they get this information at first.
    I made good experiences with internal accounting forums or user groups (i. e. northern countries, westeurope, USA, southeurope). 
    Maybe it gives you a little help and I am very interested in all the answers to this thread.
    Best regards
       Horst

  • How to get information about creation of a virtual machine on a Hyper-v host.

    Hi,
    How to get information about creation of a virtual machine on a Hyper-v host?
    I need: host name, time created, creator user.
    I saw in Hyper-V-VMMS but I found info about movements of VM between hosts.
    Thank's in advance.
    Denius Valiant

    For Host Name * Created Time Use This Command In PowerShell 
    Get-VM -Name (Read-Host "Type Your Vm Name") |select CreationTime , ComputerName
    and for Create User , As i know you should see on Event Log . 
    Go To Event Log Viewer--->Applications And Services Logs--->Microsoft--->Windows--->Hyper-V-VMMS--->Operational 
    You can see in Event Log who create the Vm.
    Whenever you see a helpful reply, click on Vote As Helpful & click on
    Mark As Answer if a post answers your question.
    LinkedIn:
      Facebook:
      

  • How to get information about cursor? I had only a reference on it.

    Hello
    How to get information about cursor, that I receive in my procedure as a reference. For example I need to know, a number of columns. I know nothing about this cursor, except the link on it.
    Best Regards, Kostya Proskudin!

    However, I would seriously reconsider what you are trying to achieve.
    It looks like you are trying to write some ultimately generic cursor processor. i.e. pass any cursor and process it in some generic way.
    Good design should include knowledge of what is expected to be passed and that knowledge can be put into the code.
    Generic code is inherently difficult to maintain and debug and will never 100% deal with all possible situations e.g. even if you know the table being queried in the cursor you can't rely on the data dictionary to give you all the returned columns if some of the returned columns of the cursor are computed columns.
    Be careful you aren't writing something that's going to cause problems later.

Maybe you are looking for