Event handling error problem

The purpose of following code is to display a list of all destinations to which flights are available on a perticular date selected by a user.On the execution of the Applet, a list of dates should be displayed in the list box and an empty destination combo box should be displayed..As soon as the user selects the date of travel and tabs out of the list box,the flights available on that perticular date should be updated in the combo box.
I have tried this program.But it shows compile time error.
Please help me to solve this problem.
error is as follows:
airline.java:29:cannot resolve symbol
symbol: method addItemListener (airline)
location: class javax.swing.JList
ldate.addItemListener(this);
^
1 error
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class airline extends JApplet implements ItemListener,ActionListener
     JPanel panel;
     JList ldate;
     JComboBox cmbdest;
     JButton b1;
     public void init()
          panel=new JPanel();
          getContentPane().add(panel);
          String date1[]={"12/21/2001","01/12/2003","03/04/2000"};
          ldate=new JList(date1);
     String dest[]={"New york","Germany","china","tibet","africa"};
          cmbdest=new JComboBox(dest);
          b1=new JButton("submit");
          panel.add(ldate);
          panel.add(cmbdest);
          panel.add(b1);
          ldate.addItemListener(this);     
          b1.addActionListener(this);
     public void itemStateChanged(ItemEvent e)
          JList ldate1=(JList)e.getItem();
          int state=e.getStateChange();
          if(state==ItemEvent.SELECTED)
          String str=String.valueOf(ldate1.getSelectedValue());
          if(str=="12/21/2001")
                    cmbdest.removeAllItems();
                    cmbdest.addItem("Germany");
                    cmbdest.addItem("china");
                    cmbdest.addItem("tibet");
                    return;
          else
               if(str=="01/12/2003")
               cmbdest.removeAllItems();
               cmbdest.addItem("tibet");
               cmbdest.addItem("New york");
               cmbdest.addItem("Africa");
               return;
               else
               if(str=="03/04/2000")
               cmbdest.removeAllItems();
               cmbdest.addItem("new york");
               cmbdest.addItem("china");
               cmbdest.addItem("Africa");
               return;
     public void actionPerformed(ActionEvent evt)
          JButton source=(JButton)evt.getSource();
          source.setText("clicked");
_______________________________________________________________

A quick look in the JList API (http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JList.html) will tell you that JList does not have a method called addItemListener. The following tutorial describes how to use JLists, including how to handle selections in the list:
"How to Use Lists":
http://java.sun.com/docs/books/tutorial/uiswing/components/list.html

Similar Messages

  • Event handler error

    I gets event handler error from the following applescript code if I leave the desktop space where "XLD" is running.
    Is there a way to avoid this error and keep running the applescript?
    tell application "System Events"
    set wnd to front window of application process "XLD"
    click button "Extract" of tool bar of wnd
    delay 1
    repeat while (name of front window of application process "XLD") = "Progress"
    end repeat
    end tell

    Do you have any Mail plug-ins installed? Mail Act-on, MailTags or whatever? If so, try disable them and then see if the scripts work.
    Alternatively, you can access the iPhoto Library from within Mail:
    Uploaded with plasq's Skitch!
    Just drag and drop to the message.
    Regards
    TD

  • Event Handler Error while Creating User

    Hi,
    I am not able to create users in OIM 11gR1 - " Event handler DemoNotificationEventResolver implemented using class/plug-in nrma.DemoNotificationEventResolver could not be loaded."
    I have deleted this plugin from the "plugins" table in the database. What else am I supposed to do?

    Hi,
    I have deleted it from the MDS Schema. Now I am getting a different error.
    <Dec 20, 2012 5:24:57 PM EST> <Error> <oracle.iam.identity.usermgmt.impl> <IAM-3050030> <An exception occurred while performing the operation.
    java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key IAM-301094
    at java.util.ResourceBundle.getObject(ResourceBundle.java:374)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:371)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:371)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:371)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at oracle.iam.ldapsync.impl.util.LDAPSyncUtil.createValidationFailedException(LDAPSyncUtil.java:700)
    at oracle.iam.ldapsync.impl.util.LDAPSyncUtil.generateAndValidateRDN(LDAPSyncUtil.java:824)
    at oracle.iam.ldapsync.impl.eventhandlers.user.RDNPreProcessHandler.execute(RDNPreProcessHandler.java:68)
    at oracle.iam.platform.kernel.impl.OrchProcessData.runPreProcessEvents(OrchProcessData.java:898)
    at oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:634)
    at oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:227)
    at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:664)
    at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.process(OrchestrationEngineImpl.java:435)
    at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:381)
    at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:334)
    at oracle.iam.identity.usermgmt.impl.UserManagerImpl.create(UserManagerImpl.java:653)
    at oracle.iam.identity.usermgmt.api.UserManagerEJB.createx(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)

  • AppleScript Event Handler Error

    While running iChat, I wanted to have notifications show up when some of my buddies log on so I don't have to guess who it was that logged on. I set for an AppleScript to run when buddies are available to Auto Accept.applescript and I get error -1708.
    An error occurred while executing an AppleScript event handler.
    Event: Buddy Becomes Available
    File: Auto Accept.applescript
    Error: Error -1708
    What does this mean?

    Dont know sorry, try chax(plug-in for iChat) as that has a lot of auto accept options http://www.macupdate.com/info.php/id/20056/chax

  • Getting error in event handler method onPlugFromStartView

    Hi,
           I am getting error in event handler method onPlugFromStartView java coding. The error message is u201CThe method wdGetwelcome componentcontroller() is undefined for the IPrivatevieew.
    Plese explain how to resolve this error to deploy the webdynpro application successfully.
    Thanks,
    Kundan.

    Hi
    1.It seems some thing corrupt or some problem .
    2. Do one exercise Create one new Dc --component -View ,In component write one method.
        a)  Open the view and then try to add that component.
    Let us know the result
    Best Regards
    Satish Kumar

  • Using yepnope, getting error in event handler.

    Recently discover yepnope and started to implement it into my project to keep common functions in one file. The first set of functions worked fine when I moved them over, but with the last one I'm unable to control a symbol.  It's calling the function fine, it's just wont play the symbol timeline.
    -------Here's the function in the external file
    //Function for audio button
    // Tests the paused attribute and set state.
    voButton = function (){
        if ($('#voiceOver')[0].paused) {
            console.log("play");
            $('#voiceOver')[0].play();
            sym.getComposition().getStage().getSymbol("btnSound").stop(1000);
        else {
            console.log("pause");
            $('#voiceOver')[0].pause();
            sym.getComposition().getStage().getSymbol("btnSound").stop(0);
    -------Here's the call to the function
    Symbol.bindElementAction(compId, symbolName, "${_btnSound}", "click", function(sym, e) {
             voButton();
    //Edge binding end
    Calling the function plays the audio but doesn't change the symbol. Getting the error message:
    functions.js (line 39)
    Javascript error in event handler! Event Type = element
    I've tried different combinations of getComposition() or getSymbol(), nothing.  I read a post somewhere that said I needed to prefix my function creation with sym. and call it the same way.  This didn't work either and caused the function to stop working, but with a new error: sym is not defined in the external file.
    Like I said the function works when I call it, but I can't access the symbol's timeline for some reason.

    I'm trying to include a custom js file to an Edge project, and I'm getting the same "sym is not defined" error. have you found a workaround for this problem?
    can't we just use "sym" or methods like "getSymbol()" in the js loaded by yepnope?
    I can't find any sources about this.
    And I can't find an easy way to substitute "sym"...
    Thanks in advance

  • Javascript error in event handler! edge 4.0.0.js, what to do about it?

    Site
    Hello everyone. I get an error in my chrome cosole, what can I do about this?
    I dont have this problem in all browsers, just in chrome, and in some versions of Firefox.
    The problem occurs when I click any label in the iframe (see website, speaks for itself).
    line 5838      window.console.log("Javascript error in event handler! Event Type = " + eventType);
    does anyone know how to fix this?
    And why do I only have this problem in some browsers?

    I basically want the labels in the Iframe to make the parent page animate to a specific anchor tag.
    ps. This is what I posted on the jquery forum as well:
    I tried to do this by letting the iframe .trigger a .click to a button on the .parent page.
    I did this in two ways.
    one: the click is triggerd in (/by) the iframe
    two: the click is triggerd by a script in the parent window, that script is launched by the iframe
    Here's the thing:
    this is what one of the <a>'s that the iframe will click looks like:
    <a class="nonblock nontext anim_swing" id="u185" href="index.html#contact"><!-- simple frame --></a>
    The code is generated by adobe muse which has a function to smoothly scroll to a location on the page, and I am guessing the "anim_swing" class takes care of that.
    I would like the colorful labels in the iframe to do the same thing as the <a> above.
    and it works in some browsers on some computers but somehow not on all of them (with method two the adblocker doesn't seem to be an issue ).
    I also tried to let the parent page scroll directly with the jquery .scrollto function. That did not work either (see the jquery forum).

  • Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]

    I'm doing a little edge project (now in beta version) for my girlfriend (she hates the code), with examples of the animate() method and other functions like setInteval(), but when I run I get the following error in Chrome console:
    Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]
    But this library is global for all projects, how is possible that trigger an error?
    Example here:
    https://app.box.com/s/m7nof4al6597gfn47jlu
    Thanks.

    you dont need to import java ease !!
    it's already included in edge animate, remove that yepnope completely your problem will gone
    Zaxist

  • Button event handler problem

    Hello,
    I need to add an Event handler to a button on my JSP page. The page refreshes very three seconds for other use.
    First, I added the following segment to the page.
    <head>
    <title>Event handler test</title>
    <script type="text/javascript">
    <!--
    function funAdd()
    alert("Your name is already in the list.");
    //-->
    </script>
    <meta http-equiv="refresh" content="3">
    </head>
    <input type = "button" name = "add" value = "Add" onclick="funAdd()" />
    Every time I clicked the Add button, the alert message appeared. It showed the expected result.
    Then, I replaced alert("Your name is already in the list."); with
    <%
    JOptionPane.showMessageDialog(null, "Your name is already in the list.", "Error message", JOptionPane.ERROR_MESSAGE);
    %>
    in funAdd().
    But, the error message showed automatically every three seconds when the page refreshed without clicking the Add button.
    Does any one know the reason, and how to solve the problem?
    Thanks in advance.
    Dan

    You said it yourself, you refresh your page each 3 seconds so each 3 seconds you do a request to your server where you show a messagedialog.

  • Problem with event handling

    Hello all,
    I have a problem with event handling. I have two buttons in my GUI application with the same name.They are instance variables of two different objects of the same class and are put together in the one GUI.And their actionlisteners are registered with the same GUI. How can I differentiate between these two buttons?
    To be more eloborate here is a basic definition of my classes
    class SystemPanel{
             SystemPanel(FTP ftp){ app = ftp};
             FTP app;
             private JButton b = new JButton("ChgDir");
            b.addActionListener(app);
    class FTP extends JFrame implements ActionListener{
               SystemPanel rem = new SystemPanel(this);
               SystemPanel loc = new SystemPanel(this);
               FTP(){
                       add(rem);
                       add(loc);
                       pack();
                       show();
           void actionPerformed(ActionEvent evt){
            /*HOW WILL I BE ABLE TO KNOW WHICH BUTTON WAS PRESSED AS THEY
               BOTH HAVE SAME ID AND getSouce() ?
               In this case..it if was from rem or loc ?
    }  It would be really helpful if anyone could help me in this regard..
    Thanks
    Hari Vigensh

    Hi levi,
    Thankx..
    I solved the problem ..using same concept but in a different way..
    One thing i wanted to make clear is that the two buttons are in the SAME CLASS and i am forming 2 different objects of the SAME class and then putting them in a GUI.THERE IS NO b and C. there is just two instances of b which belong to the SAME CLASS..
    So the code
    private JButton b = new JButton("ChgDir");
    b.setActionCommand ("1");
    wont work as both the instances would have the label "ChgDir" and have setActionCommand set to 1!!!!
    Actually I have an array of buttons..So I solved the prob by writting a function caled setActionCmdRemote that would just set the action commands of one object of the class differently ..here is the code
    public void setActionCommandsRemote()
         for(int i = 0 ; i <cmdButtons.length ; i++)
         cmdButtons.setActionCommand((cmdButtons[i].getText())+"Rem");
    This just adds "rem" to the existing Actioncommand and i check it as folows in my actionperformed method
         if(button.getActionCommand().equals("DeleteRem") )          
                        deleteFileRemote();
          else if(button.getActionCommand().equals("Delete") )
                     deleteFileLocal();Anyway thanx a milion for your help..this was my first posting and I was glad to get a prompt reply!!!

  • View not copied or enhanced with wizard Error while creating Event Handler method in Z Component

    Hello Friends,
    In one Z Component (Custom Component), in one of the views, while creating event handler, it gave me error message that view not copied or enhanced with wizard.
    I am aware that in Standard Component, if we want to create the event handler method then we need to first Enhance the Component and then we need to enhance the view.
    But, in the Z Component (Custom Component), how to create event handler method in one of the views as while creating event handler method i am getting view not copied or enhanced with wizard error.

    Hi,
    Add a method in views impl class with naming convention eh_on__* with htmt and html_ex parameters.  I dont have have the system right now. Please check any existing event import export parameters.
    Check out do handle event method in the same class.
    Redefine that method.  Call that event method in this handle method. See existing code for reference.
    Attach that event to the button on click event in .htm page.
    Regards,
    Bhushan

  • I can't open iTunes on my pc in windows. I keep getting a Problem event: BEX error.

    can't open iTunes on my pc in windows. I keep getting a Problem event: BEX error.  How can i fix this?  need very detailed step by step instructions on how to fix. thx

    Check out this discussion link:
    https://discussions.apple.com/thread/2777410?threadID=2777410&tstart=15

  • BSP extension "download" - event handling problem

    Folks,
    First of all, I apologize if the answer is already out there, but I spent quite some time to find the solution for my problem but finally gave up:
    I implemented the Download extension from Brian's and Tom's book. Since I am using an MVC based app, I put the event handling in the DO_HANDLE_EVENT of a controller instead of the OnInputProcessing event of a page. Here's how my app is designed:
    I have a main controller that has an execute button to trigger a data selection based on some selection criteria. The result of this selection is displayed by means of a subcontroller with tableviews that are wrapped into my “zdownload” extension. Everything works fine: I make my selections, execute the app through the button of the main controller and get my result shown in the tableviews. I push the download icon, select my file format (XLS, HTML etc), get the dialog to choose whether to download or to display the file, perfect!
    But now – after I processed the download successfully - if I click the execute button in the main controller again, I still get the download dialog. It looks like the created event for the download does not get cleared. As I mentioned, I searched through SDN, but all I found were referrals to the call of DISPATCH_INPUT( ) in DO_REQUEST of the main controller, but unfortunately this one is already implemented.
    Any ideas?
    Thanks,
    Guenther

    There is an attribute of the download extension called display_url. You pass a value to the extension telling it what cached URL contains the binary content for your download.  if this display_url attribute has a value assigned to it, then the element will render an iFrame to call the URl.  However if the display_url attribute is empty, it won't render the iFrame.  I suspect that you have a stateful application and after your download event you aren't clearing whatever field that you pass into the display_url attribute.

  • Event handler problems

    Hi,
    I'm having problems with a event handler that I'm trying to create.
    I currently have 2 event handlers, one of which needs to only happen when Shift + a key is pressed. I currently have:
    function keypressedHandler(event:KeyboardEvent):void {      if ((event.shiftKey) + (event.keyCode == 81)) {        //something would happen      } } 
    So my question is how can I get the shift function to work? It doesn't matter if it isn't shift but Alt or Ctrl would be the alternatives.
    Any help would be great,
    Thanks,

    You need the ampersand (&) instead of the plus sign to use the logical AND:
    stage.addEventListener( KeyboardEvent.KEY_DOWN, keypressedHandler )
    function keypressedHandler(event:KeyboardEvent):void
        if ((event.shiftKey) && (event.keyCode == 65))
            //something would happen     
            trace( "shift and 65" )

  • Error in post process event handler

    We should write a post process event handler that updates the manager field. So, I used the following code to update the manager field when a user gets created:
    Code:
    public EventResult execute(long processId, long eventId,
    Orchestration orchestration) {
    System.out.println("Test for Event Handler");
    try
    String userKey = getUserKey(processId, orchestration);
    System.out.println("USERKEY1"+userKey);
    UserManager userMgmt = Platform.getService(UserManager.class);
    System.out.println("USERMANAGEMENT"+userMgmt);
    System.out.println(userMgmt.modify(new User(userKey)));
    userMgmt.modify("usr_mgr_key","28",new User(userKey));
    System.out.println("USERKEY2"+userKey);
    } catch (ValidationFailedException e) {
    System.out.println("Exception1");
    } catch (AccessDeniedException e) {
    System.out.println("Exception2");} catch (UserModifyException e) {
    System.out.println("Exception3");} catch (NoSuchUserException e) {
    System.out.println("Exception4");} catch (SearchKeyNotUniqueException e) {
    return new EventResult();
    private String getUserKey (long processID, Orchestration orchestration) {
    String userKey;
    String entityType = orchestration.getTarget().getType();
    EventResult result;
    result = new EventResult();
    System.out.println("Entity Type"+entityType);
    System.out.println("Process ID"+processID);
    if (!orchestration.getOperation().equals("CREATE")) {
    userKey = orchestration.getTarget().getEntityId();
    System.out.println("UserKEY0"+userKey);
    } else {
    OrchestrationEngine orchEngine = Platform.getService(OrchestrationEngine.class);
    userKey = (String) orchEngine.getActionResult(processID);
    System.out.println("UserKEY-1"+userKey);
    return userKey;
    It compiles fine and when we try to create a user, the user gets created successfully. But, the expected behaviour of upadting the manager field with the user key '28' is not happening. My approach above - is it right or is there any other method that will make it work?
    The output message I see is:
    Test for Event Handler
    Entity TypeUser
    Process ID140343
    UserKEY-1613
    USERKEY1613
    USERMANAGEMENToracle.iam.identity.usermgmt.api.UserManagerDelegate@75ecf9ed
    <27-Feb-2012 10:56:41 o'clock GMT> <Warning> <oracle.iam.callbacks.common> <IAM-2030146> <[CALLBACKMSG] Are applicable policies present for this async eventhandler ? : false>
    oracle.iam.identity.usermgmt.vo.UserManagerResult@14da2ada
    <27-Feb-2012 10:56:44 o'clock GMT> <Error> <oracle.iam.identity.usermgmt.impl> <IAM-3051212> <An error occurred while searching for users - : [usr_mgr_key].>
    Exception4
    Thanks
    Krish

    i hope wrong coding.
    Use this code.
    UserManager userMgmt = oimClient.getService(UserManager.class);
    //Attribute you want to modify
    HashMap<String, Object> atrrMap= new HashMap<String, Object>();
    atrrMap.put("usr_manager_key", Long.valueOf("1")); //user will upadated with manager key 1 (xelsysadm) make sure usr_key 1 (manager) exist in OIM.
    //get the user to whom you want to modify
    User user = userMgmt.getDetails("usr_key", "41", null);
    user = new User(String.valueOf(user.getId()), atrrMap);
    UserManagerResult result = userMgmt.modify("usr_key", String.valueOf("41"), user);
    //UserManagerResult str = userMgmt.modify("usr_mgr_key","111",new User("41"));
    System.out.println("UserUpdate.process() "+result.getStatus());
    Also don't use UserManager class, As it will go for looping.
    Use
    EntityManager entityManager = Platform.getService(EntityManager.class);
    entityManager.modifyEntity(orchestrationTarget.getType(), userKey, mapAttrs);
    Also I am assuming you want to use Associate manager With user use case.
    Thanks,
    Kuldeep

Maybe you are looking for

  • I have problem with Bluetooth on my Qosmio G20

    Hi I have problem with Bluetooth. I cannot use it because it is always off. (Why Bluetooth Settings reports "Bluetooth is not Ready.") I gone to Pro.Center in our area and he side (you delete your .. Definition of the Bluetooth! But how!!! whatever H

  • ITunes wont open (locked disc msg)

    The reason Displayed the Folder "iTunes" is on a locked disk or you do not have write permissions for the folder. the history I have had various problems with corrupted library and duplicated song files so i have recent had to manually remove all dup

  • Help with importing .mov file from iphoto

    I have a casio exilim ex-z1080 digital camera. I have imported the jpg and mov files into iphoto, but can't seem to get it to import into imovie. i read a similar post to mine but could not understand. can anyone help in lay person's terms? how do i

  • Replicating System Stored Procedures in MSA Setup

    I started replicating system stored procedures in my MSA environment due to the fact that commands such as sp_rename was not making it to my MSA server. This caused some issues downstream resulting in the DSI goign down and having to manually apply t

  • Loop(block)

    plz pay attention to question especially(masijade. ) i won't ask u for childdish code sry for that. one more error the code u give me doesn't work for the subblock which is 2x2 and more than 2 dimension how to write the code to multiply each processo