Custom event mask

I have defined a custom new event:
private class MyEvent extends AWTEvent {
          public MyEvent(Object source, String msg) {
               super(source, 2000);
               this.msg = msg;               
          public String getMsg() {
               return msg;
          private String msg;
     }as you can see the id is 2000 which is bigger than AWTEvent.RESERVED_ID_MAX
Now in the constructor of my JFrame: CustomEventListener
I've added the following code:
Toolkit.getDefaultToolkit().addAWTEventListener(
                    this, 2000);I want to be able that when I call "disptachEvent" with my event the method
"eventDispatched" will be called in my code, but I don't understand
what value should I set the mask in the addAWTEventListener method.
And in general I don't understand how the correlation between masks
to events work, is there some formula that if the event's id is x then
the mask should be some multiple of x or something like that?
Here is my full application:
import java.awt.AWTEvent;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class CustomEventListener extends JFrame implements
AWTEventListener, ActionListener {
      * @param args
     public static void main(String[] args) {
          JFrame myFrame = new CustomEventListener();
          myFrame.setVisible(true);
          myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     public CustomEventListener() {
          setLayout(new FlowLayout());
          btn = new JButton("Click me");
          add(btn);
          textField = new JTextField(10);
          add(textField);
          pack();
                // what value should I use for the mask
          Toolkit.getDefaultToolkit().addAWTEventListener(
                    this, 2000);
     public void eventDispatched(AWTEvent event) {
          System.out.println("boga boga");                    
     public void actionPerformed(ActionEvent e) {
          if (e.getSource() == btn) {
               dispatchEvent(new MyEvent(this, "the button has been clicked"));
     private JButton btn;
     private JTextField textField;
     private class MyEvent extends AWTEvent {
          public MyEvent(Object source, String msg) {
               super(source, 2000);
               this.msg = msg;               
          public String getMsg() {
               return msg;
          private String msg;
}I know that I can use listeners in this example, but I don't
want to use a listener for the dispatching of my event for reasons
which are a bit hard to explain.
Thanks in advance

Hi,
First say ur Jdev Version................
U can validate in ADF in both Model and ViewLayer itself... In ViewLayer u can have Validators as regular Expression Validators
Have a look into these first....
http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_validateRegExp.html
http://download.oracle.com/docs/cd/E14571_01/web.1111/b31973/af_validate.htm#ADFUI827
Regards,
Suganth.G

Similar Messages

  • Custom Events and Scheduling more than once

    Hi,
    in BO 4.1, I successfully triggered WebI Report instance generation by a "Custom Event" through scheduling.
    Now, we have the requirement that the report should not be triggered only once but always when the event is triggered.
    At first glance, this looks tricky bc. in order that the report "reacts" to the event, the report itself must be scheduled with the event (it gets an instance "pending" that "wait + reacts" to the event). So it looks like we need schedule the report always manually with "event" before it is ready to react to the event specified in the scheduling.
    Is there any user-friendly trick to make the report react upon every fired event without having to "schedule" the report manually with the event?
    (Similar to schedule daily, just that the event is the trigger, note a daytime...)
    Best Regards

    Hi Florian,
    What is the frequency set under Recurrence option for the report instance?
    Can you give an idea like after how much time the event can be triggered?
    For example, if you are expecting the event to change in an hour, you can schedule the recurrence as hourly or you can specify something like 0 hours and 15 minutes or something like that.
    In that case, once the event is fired, your report instance will be ready to trigger after 15 minutes for the next run.
    Would suggest you to sync with the BO administrator as concurrent triggering of large number of instances can give load on Job Servers.
    Hope it will help in some way.
    Regards,
    Yuvraj

  • Can you send custom events from one form to another?

    I have a compli
    cated application, where I about hundred inp
    uts organized in several input forms. Some of the forms
    require data which has been input in other forms. I have tried to
    dispatch custom events from one form to another, but it dispatches the
    whole form and I only need one or two items.
    Ha anybody else come across such a problem?
    Svend

    One way is to share data in a static singleton

  • Custom Events and Listeners between classes

    I've got a project I've been working on for weeks that I'm
    having yet another problem with. I'm trying to learn AS3 which is
    why it's taking so long but that's not important for this post.
    I wanted to create a custom event class so that I could make
    sure the event does not interfere with other "COMPLETE" events that
    are being passed between classes. In other words, I have a few
    things that need to complete prior to a function being called...
    one is some XML being loaded and another is a font loaded. So, I
    thought I would create a custom FontLoaded class that extends Event
    and make the type something like "FontLoadedEvent.LOADED". That way
    I could listen for the XML "Event.COMPLETE" and this font event
    also.
    Please tell me if I'm going down the wrong path here but I
    don't seem to be getting the dispatched event for my new custom
    event. Also, how does one detect if it's being dispatched other
    than if the eventListener is fired? Any other ways to test
    this?

    You can trace the event to see if it dispatched.
    Also, this is not a good case to create a new event. Custom
    events are used to store additional information. MouseEvent exists
    because Event doesn't have localX, localY, etc. properties. Since
    you don't seem to be throwing additional properties, you can use a
    regular event.
    trace(dispatchEvent(new Event("panelFontsLoaded"));
    addEventListener("panelFontsLoaded", onFontsLoaded);
    Static consts are used to help debug typos. The event type is
    just a string, often stored in a const.

  • Issue in using custom event from outreach

    Hi
    I have created a custom event and executed a scenario successfully for this custom event from ACC. But when I try to configure the same event from Outreach(BCC), I am able to see this custom event in the list of available events, but after selecting this event there is no option to configure attributes for this event, but I can configure attributes in ACC. My BCC version is 10.1.1
    Edited by: 1002715 on Apr 26, 2013 3:06 AM

    Dear Ankit,
    Once the pricing procedure is downloaded, please maintain the document pricing procedure at service contract header level, and maintain the customer pricing procedure at business partner sales area billing data.
    In spro, maintain the pricing procedure for the combination of sales area, document pricing procedure, customer pricing procedure.
    Please crosscheck whether the condition table is active or not.
    Regards,
    Maddy

  • Mac OS / classpath / custom event problem

    I'm having a bit of trouble with a particular classpath
    anomaly, and I have a feeling that it might be a Mac thing.
    Not sure if anyone else can reproduce this, but I managed to
    make a custom event and a class that extends the EventDispatcher
    once. Since then, Flash has refused to admit that any class
    associated with a custom event exists - mostly producing the error
    1046. Even after you take out any references to the event
    dispatcher or a custom event, the class is ignored.
    All my classes are kept in a single 'Packages' folder with
    sub folders that I include in the import statement (I've
    triple-checked the classpath settings, the import statements, and
    the classes themselves - I have probably a hundred or so other
    classes that are fine, and all referenced in the same way, some
    that extend EventDispatcher, some that don't.
    I come across this a few times now - once I was able to fix
    it by putting the .as file in the same folder as my first custom
    event, but this no longer works.
    I'm running Mac OS X 4.11 on two computers - both have the
    same trouble.
    I've tried copying the classes to other folders and changing
    the package/import path accordingly - no go.
    Even stranger, if you copy and paste to a new .as file, and a
    different package folder, the problem persists in that Flash claims
    the revised Package statement (to reflect the new location) does
    not reflect the position of the file - when it clearly does.
    I haven't had this problem with any other home-grown class -
    only those that reference a custom event.
    It sounds like it should be pilot error, and I've spent a
    long time trying to spot a silly mistake. But as this problem has
    recurred a few times now, I'm beginning to think it isn't me.
    Anybody else experience similar classpath problems with AS3
    on a Mac? Anybody have any suggestions?

    I am also a newbie and my answer could be wrong.
    But from the looks of it, You are Unable to load performance pack.
    The solution is "Please ensure that libmuxer library is in :'.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    I hope BEA or someone can tell you the file name of libmuxer. And make sure it is in the Folder where the script is searching/looking.
    Good luck.
    fred

  • Can you edit or add a custom event to contacts to show in Birthday Subscription calendar

    I want to modfy Birthday subscription calendar to include custom events that appear in my Contacts. Is there a way to do this?
    Or how can I create a new subscription calendar to be published in my iCloud acct pulling the custom events from Contacts?

    You have some contacts with more than one birthday?
    To add a custom label for a date, select Edit for an existing contact. Select Add Field. Select Date. Scroll up with the Info window above the date selection and select Other for the new date selection. Select Add Custom Label and then select this label for the new date field for the contact.
    As far as linking dates with multiple contacts, the answer is no to that.

  • I am trying to trigger a custom event using a program but does not work ..

    HI ....i am trying to trigger a custom event of a custom object type using a program but does not work. If trigger the same event using SWUE it works.
    below is the code...
    {Key = '0010001115'. "Sales Order Number (hard-coded)
    CALL FUNCTION 'SWE_EVENT_CREATE'
      EXPORTING
        objtype                       = 'ZXXXXXXXF'
        objkey                        = KEY
        event                         = 'ZEVENT'
      CREATOR                       = ' '
      TAKE_WORKITEM_REQUESTER       = ' '
      START_WITH_DELAY              = ' '
      START_RECFB_SYNCHRON          = ' '
      NO_COMMIT_FOR_QUEUE           = ' '
      DEBUG_FLAG                    = ' '
      NO_LOGGING                    = ' '
      IDENT                         =
    IMPORTING
      EVENT_ID                      =
      RECEIVER_COUNT                =
    TABLES
      EVENT_CONTAINER               =
    EXCEPTIONS
      OBJTYPE_NOT_FOUND             = 1
      OTHERS                        = 2}
    Please guide me if i am missing something.

    Hi Sunny,
    I think you should try creating the event using FM SAP_WAPI_CREATE_EVENT.
    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
      EXPORTING
        OBJECT_TYPE             =  'ZXXXXXXXF'
        OBJECT_KEY              = key
        EVENT                   = 'ZEVENT'
    *   COMMIT_WORK             = 'X'
    *   EVENT_LANGUAGE          = SY-LANGU
    *   LANGUAGE                = SY-LANGU
    *   USER                    = SY-UNAME
    *   IFS_XML_CONTAINER       =
    IMPORTING
       RETURN_CODE             = rcode
       EVENT_ID                = event_id
    * TABLES
    *   INPUT_CONTAINER         =
    *   MESSAGE_LINES           =
    *   MESSAGE_STRUCT          =
    Regards,
    Saumya

  • How to Access Custom Event using AS3?

    Hi All,
    Maybe it's that its Monday morning and my brain is still foggy, but I can't seem to figure out how to set custom events using AS3.
    I have a custom GridRow itemRenderer, and have declared the event using the appropriate metatags.
    Then I create the GR item dynamically using AS3 instantiation, but the event is not available for selection in the intellisense drop-down.
    Let's take the following as an example:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Grid
         xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:renderers="com.brassworks.renderers.*"
         creationComplete="componentInit();"
    >
         <mx:Script>
              <![CDATA[
                   private function componentInit():void
                        newRow     :MyRow     = new MyRow();
                        //newRow.myEvent is not an available option to set
              ]]>
         </mx:Script>
    </mx:Grid>
    Then the itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <GridRow
         xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:classes="com.brassworks.components.classes.*"
         creationComplete="componentInit();"
    >
         <mx:Metadata>
              [Event(name="myEvent", type="flash.events.Event")]
         </mx:Metadata>
         <mx:Script>
              <![CDATA[
                   private function itemChanged(event:Event):void
                   Alert.show("test");
                   this.dispatchEvent(new Event("myEvent"));
              ]]>
         </mx:Script>
         <mx:GridItem>
              <mx:TextInput
                   change="itemChanged"
              />
         </mx:GridItem>
    </GridRow>
    How do I go about setting the handler method for custom events on instantiated items? Do I need to do this via the AddEventListener() method? Does this mean that events aren't exposed in ActionScript like they are in MXML? (In MXML all I have to do is <MyRow myEvent="handler(event)" />.)
    Thanks!
    -Mike

    Yes, I you need to do this via the addEventListener() method.
    myRow.addEventListener( "myEvent", myHandler );
    I hope that helps.
    Ben Edwards

  • Custom event in popup w/ dynamic region does not reach its server listener

    Here's the situation:
    I have a fragment taskflow. Inside this taskflow's fragment, I am firing 2 custom client event that is being listened to by 2 server listeners. All of these are working fine when I use the taskflow as a region on a page. But when I use it as a dynamic region inside a popup, only the first event gets processed, the second one(and all subsequent ones) don't reach their respective server listeners.
    Additional detail, all 2 custom events are on the same component(an inputText).
    Is this an ADF bug or am I doing something wrong?
    Edited by: Hyangelo on Aug 3, 2011 5:12 AM

    bump

  • Custom event handler

    Just curious. I made a custom event handler that is
    dispatched from within a class when an XML document is loaded. The
    listener is attached to the instance of that class in the FLA. The
    attached code to this thread is what is for the class instance.
    Does that have to be out there? Is there a cleaner way to do it so
    that the code would be away in a class? Just wondering....
    Thanks!

    Well I need my instance to know when the data is loaded into
    the object, but I wish there was a more transparent way to do it. I
    guess I could somehow put that stuff into the initiation of the
    class....

  • Custom Event generation and Handling

    HI all,
    I am new to java. I have a dataset which changes dynamically and this dataset is responsible for some other dataset(s). So whenever the original dataset is modified, the other datasets based on this dataset should be updated automatically so as to preserve the consistency.
    What I want to do is to write a custom event which is to be fired whenever the original dataset is modified and notify it to other datasets so as to ensure the consistency.
    Any help in this regard is extremely appreciated.

    HI Duffymo,
    Here is my problem for better understanding:
    I have a vector data in a NodePanel (this vector data originates from some other datastructure...but that is immaterial as we know that this data is an instance of that datastructure). This vectordata in NodePanel is responsible for another vectordata in SchedulePanel. The NodePanel and SchedulePanel are tabbedPanels in a tabbedframe. Whenever I update the vector data in NodePanel, the vector data in SchedulePanel needs to be updated.
    The solution you gave me, taught me an insight of the event handling in Java.
    I am quoting my source for your reference as I am unable to incorporate your idea into my project.
    Event class:
    import java.util.*;
    public class VectorUpdateEvent extends EventObject
         public VectorUpdateEvent(Object source)
              super(source);
    Interface to EventListener
    public interface VectorUpdateListener
         public void eventVectorUpdated(VectorUpdateEvent event);
    class EventGenerator
    import java.util.*;
    public class VectorUpdateEventIssuer
         implements EventListener
         public VectorUpdateEventIssuer()
              listListeners = new ArrayList();
         public synchronized void addVectorUpdateEventListener(VectorUpdateEvent l)
              listListeners.add(l);
         protected synchronized void removeVectorUpdateEventListener(VectorUpdateEvent l)
              listListeners.remove(listListeners.indexOf(l));
         protected void notifyVectorUpdateEvent(Object source)
              VectorUpdateEvent evt = new VectorUpdateEvent(source);
              Iterator itr = listListeners.iterator();
              while (itr.hasNext())
                   ((VectorUpdateListener)itr.next()).eventVectorUpdated(evt);
         private ArrayList listListeners;
    class where the event originates
    class NodePanel
         extends JPanel
         implements ActionListener, ListSelectionListener
         /////////////Constructors/////////////////////////
         public NodePanel()
              addNodeButton = new JButton("Add Node");
              delNodeButton = new JButton("Delete Node");
              dumpNodeButton = new JButton("Dump Node");
              reloadNodeButton = new JButton("Reload Node");
              browseButton = new JButton("Browse Node");
              exitButton = new JButton("Exit");
              add(addNodeButton);
              add(delNodeButton);
              add(dumpNodeButton);
              add(reloadNodeButton);
              add(browseButton);
              add(exitButton);
              setButtonsEnabled(false);
              addNodeButton.addActionListener(this);
              delNodeButton.addActionListener(this);
              dumpNodeButton.addActionListener(this);
              reloadNodeButton.addActionListener(this);
              browseButton.addActionListener(this);
              exitButton.addActionListener(this);
              nodesVector = new Vector();
              nodesList = new JList(nodesVector);
              this.vectorNodeAttributes = new Vector();
              JScrollPane scrollPane = new JScrollPane(nodesList);
              add(scrollPane,BorderLayout.CENTER);
              nodesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              nodesList.addListSelectionListener(this);
         ////////////////Methods///////////////////////////
         /////////////Event valueChanged///////////////////
         public void valueChanged(ListSelectionEvent evt)
              JList source = (JList) evt.getSource();
              setButtonsEnabled(true);
              desiredNode = (String) source.getSelectedValue();
              if (desiredNode == null)
                   setButtonsEnabled(false);
         //////////////Event actionPerformed////////////
         public void actionPerformed(ActionEvent evt)
              Object source = evt.getSource();
              if (source == addNodeButton)
                   addNodeButtonClicked();
              else if (source == delNodeButton && desiredNode != null)
                   deleteNodeButtonClicked();
              else if (source == dumpNodeButton && desiredNode != null)
                   JFileChooser d = new JFileChooser();
                   //d.setCurrentDirectory("");
                   d.setFileFilter(new XMLFilter());
                   int result = d.showSaveDialog(this);
              else if (source == reloadNodeButton && desiredNode != null)
                   JFileChooser d1 = new JFileChooser();
                   //d.setCurrentDirectory("");
                   d1.setFileFilter(new XMLFilter());
                   int result = d1.showOpenDialog(this);
                   //String filename=d1.getSelectedFile().getName();
              if (source == browseButton && desiredNode != null)
                   browseButtonClicked();
              else if (source == exitButton)
                   System.exit(0);
         //////////Enables or Diables the Buttons////////
         private void setButtonsEnabled(boolean enable)
              delNodeButton.setEnabled(enable);
              dumpNodeButton.setEnabled(enable);
              reloadNodeButton.setEnabled(enable);
              browseButton.setEnabled(enable);
              private void deleteNodeButtonClicked()
              if (noFieldDlg != null)
                   noFieldDlg.dispose();
              noFieldDlg = new NoFieldDialog("Delete the Node?");
              noFieldDlg.show();
              if (noFieldDlg.getDialogResult() == DialogResult.OK)
                   int nodeToRemove=0;
                   for (int i=0; i< vectorNodeAttributes.size(); i++)
                        if(((NodeAttributes)(vectorNodeAttributes.get(i))).getNodeName().compareTo(nodesList.getSelectedValue()) == 0)
                             nodeToRemove = i;
                   vectorNodeAttributes.remove(nodeToRemove);
                   nodesVector.removeElement(nodesList.getSelectedValue());
                   this.nodesList.setListData(nodesVector);
                   NodePanel.nodesPresent = nodesVector;
                   updateStaticNodeList();
    /*************** as soon as the NodePanel.nodesPresent is updated, the changes are to be reflected in the Schedule Panel ******************/
                   VectorUpdateEvent e = new VectorUpdateEvent(this);
                   VectorUpdateEventIssuer v = new VectorUpdateEventIssuer();
                   v.addVectorUpdateEventListener(e);
                   v.notifyVectorUpdateEvent(this);
         ///////////////Data Members////////////////////
         private JButton addNodeButton;
         private JButton delNodeButton;
         private JButton dumpNodeButton;
         private JButton reloadNodeButton;
         private JButton browseButton;
         private JButton exitButton;
         private String desiredNode;
         private OneFieldDialog oneFieldDlg = null;
         private NoFieldDialog noFieldDlg = null;
         private JList nodesList;
         private Vector nodesVector;
         private Vector vectorNodeAttributes;
         private static Vector nodesPresent = null;
    } // end class NodePanel
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    ////////////////Class SchedulePanel////////////////
    class SchedulePanel extends JPanel
    implements ActionListener, ListSelectionListener, VectorUpdateListener
         ////////////////Constructors//////////////////
         public SchedulePanel()
              addScheduleButton = new JButton("Add Schedule");
              delScheduleButton = new JButton("Delete Schedule");
              dumpScheduleButton = new JButton("Dump Schedule");
              reloadScheduleButton = new JButton("Reload Schedule");
              browseScheduleButton = new JButton("Browse Schedule");
              exitButton = new JButton("Exit");
              add(addScheduleButton);
              add(delScheduleButton);
              add(dumpScheduleButton);
              add(reloadScheduleButton);
              add(browseScheduleButton);
              add(exitButton);
              setButtonsEnabled(false);
              addScheduleButton.addActionListener(this);
              delScheduleButton.addActionListener(this);
              dumpScheduleButton.addActionListener(this);
              reloadScheduleButton.addActionListener(this);
              browseScheduleButton.addActionListener(this);
              exitButton.addActionListener(this);
              scheduleVector = new Vector();
              scheduleList = new JList(scheduleVector);
              this.vectorScheduleOperations = new Vector();
              JScrollPane scrollPane = new JScrollPane(scheduleList);
              add(scrollPane);
              scheduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              scheduleList.addListSelectionListener(this);
              //updateEventListener = new VectorUpdateEventIssuer();
              //updateEventListener.addVectorUpdateEventListener(this);
         /////////////Methods///////////////////////
         ////////////Event valueChanged/////////////
         public void valueChanged(ListSelectionEvent evt)
              JList source = (JList)evt.getSource();
              setButtonsEnabled(true);
              desiredSchedule = (String)source.getSelectedValue();
              if (desiredSchedule == null)
                   setButtonsEnabled(false);
         ////////////Event actionPerformed////////
         public void actionPerformed(ActionEvent evt)
              Object source = evt.getSource();
              if (source == addScheduleButton )
                   addScheduleButtonClicked();
              else if (source==delScheduleButton && desiredSchedule!=null)
                   deleteScheduleButtonClicked();
              else if (source == dumpScheduleButton && desiredSchedule!=null)
                   JFileChooser d = new JFileChooser();
                   d.setFileFilter(new XMLFilter());
                   int result = d.showSaveDialog(this);
              else if (source == reloadScheduleButton && desiredSchedule!=null)
                   JFileChooser d1 = new JFileChooser();
                   d1.setFileFilter(new XMLFilter());
                   int result = d1.showOpenDialog(this);
              else if (source == browseScheduleButton && desiredSchedule!=null)
                   browseScheduleButtonClicked();
              else if (source == exitButton)
                   System.exit(0);
         public void eventVectorUpdated(VectorUpdateEvent event)
              System.out.println("Hello! EventRaised");
         ///////////Data Members//////////////////
         private JButton addScheduleButton;
         private JButton delScheduleButton;
         private JButton dumpScheduleButton;
         private JButton reloadScheduleButton;
         private JButton browseScheduleButton;
         private JButton exitButton;
         private String desiredSchedule;
         private OneFieldDialog oneFieldDlg = null;
         private NoFieldDialog noFieldDlg = null;
         private JList scheduleList;
         private Vector scheduleVector;
         private Vector vectorScheduleOperations;
         private VectorUpdateEventIssuer updateEventListener;
    } // end class SchedulePanel
    I hope you understood my problem now. The NodeAttributes is a datastructure containing the node name and an associated table for that. THe ScheduleOperations is similar to the NodeAttributes but it contains a DefaultTableModel which inturn consists of a column which is filled with the list of current nodes available + their schedules.
    I am sorry for my long posting.
    Thanks once again in anticipation.

  • Problem reading custom property file from custom event handler.

    Hi,
    My custom event handler needs some bits of information that I have set up in a property file. However, when the event handler runs it throws a FileNotFound exception - actually its because permission was denied.
    I have added the code System.getProperty("user.name") to find out the actual user that the event handler is running as. It reports that "oracle" is the user.
    That's great. However, the permissions on the file will allow oracle to read/write the file. If I log onto the server where OCDB runs (as oracle), I can vi the file.
    The file is owned by another user, but the "oracle" is a member of the group that has read/write (we're running on a unix box). The file is not 777.
    The event handler is actually calling a static utility method that returns the Properties. This utility is used elsewhere in other custom apps in conjunction with OCDB (on the same server). It works there, so the utility is functioning correctly.
    Is there something going on that I'm missing? Like somehow the event handler is acually runn as somebody else?
    Here is the node log.
    2007/07/17 12:52:16 [oracle.ifs] [37] 434364 system FINE: Error /opt/csc/sfi/configuration/sfi.properties (Permission
    denied) Additional INFO: java.io.FileNotFoundException: /opt/csc/sfi/configuration/sfi.properties (Permission denied)
    Thanks in advance for the help.
    Winston

    Matt,
    Sorry to have wasted your time. It was a server reboot issue. The ocdb server hasn't been restarted since early July. We added the users and groups late last week. Although we tested on line, the server wasn't quite up to speed with the new changes.
    We bounced the server and all is well.
    Thanks
    Winston

  • Need help with custom event from Main class to an unrelated class.

    Hey guys,
    I'm new to Flash and not great with OOP.  I've made it pretty far with google and lurking, but I've been pulling my hair out on this problem for a day and everything I try throws an error or simply doesn't hit the listener.
    I'm trying to get my Main class to send a custom event to an unrelated class called BigIcon.  The rest of the code works fine, it's just the addEventListener and dispatchEvent that isn't working.
    I've put in the relevant code in below.  Let me know if anything else is needed to troubleshoot.  Thank you!
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                placeIcons();
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 4; i++)
                    for (j = 0; j < 5; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i,j);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
            function twitchUp(e:Event)
                this.y +=  10;

    Ned Murphy wrote:
    You should be getting an error for the Main.as class due to missing a line to import the Event class...
    import flash.events.Event;
    My apologies, I should attempt to compile my example code before I ask for help...
    Alright, this compiles, gives me no errors, shows my 'book' and 'flowers' icons perfectly when ran, and prints 'addEventListener' to the output window as expected.  I get no errors when I press the button, 'dispatchEvent' is output (good), but the 'twitchUp' function is never called and 'EventTriggered' is never output. 
    How do I get the 'twitchUp' event to trigger?
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.*;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            var iconString_array:Array = new Array(2);
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                buildStringArray();
                placeIcons();
            function buildStringArray():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    iconString_array[i] = new Array(3);
                    for (j = 0; j < 3; j++)
                        if (Math.random() > .5)
                            //'flowers' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "flowers";
                        else
                            //'book' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "book";
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    for (j = 0; j < 3; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i*50,j*50);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
                trace("dispatchEvent");
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.*;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
                trace("addEventListener");
            function twitchUp(e:Event)
                this.y +=  10;
                trace("EventTriggered");
    Output:
    [SWF] Untitled-1.swf - 40457 bytes after decompression
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    dispatchEvent
    [UnloadSWF] Untitled-1.swf
    Test Movie terminated.

  • Implementing Custom Event - non-static referencing in static context error

    Hi,
    I'm implementing a custom event, and I have problems adding my custom listeners to objects. I can't compile because I'm referencing a non-static method (my custom addListener method ) from a static context (a JFrame which contains static main).
    However, the same error occurs even if I try to add the custom listener to another class without the main function.
    Q1. Is the way I'm adding the listener wrong? Is there a way to resolve the non-static referencing error?
    Q2. From the examples online, I don't see people adding the Class name in front of addListener.
    Refering to the code below, if I remove "Data." in front of addDataUpdatelistener, I get the error:
    cannot resolve symbol method addDataUpdateListener (<anonymous DataUpdateListener>)
    I'm wondering if this is where the error is coming from.
    Below is a simplified version of my code. Thanks in advance!
    Cindy
    //dividers indicate contents are in separate source files
    //DataUpdateEvent Class
    public class DataUpdateEvent extends java.util.EventObject
         public DataUpdateEvent(Object eventSource)
              super(eventSource);
    //DataUpdateListener Interface
    public interface DataUpdateListener extends java.util.EventListener
      public void dataUpdateOccured(DataUpdateEvent event);
    //Data Class: contains data which is updated periodically. Needs to notify Display frame.
    class Data
    //do something to data
    //fire an event to notify listeners data has changed
    fireEvent(new DataUpdateEvent(this));
      private void fireEvent(DataUpdateEvent event)
           // Make a copy of the list and use this list to fire events.
           // This way listeners can be added and removed to and from
           // the original list in response to this event.
           Vector list;
           synchronized(this)
                list = (Vector)listeners.clone();
           for (int i=0; i < list.size(); i++)
                // Get the next listener and cast the object to right listener type.
               DataUpdateListener listener = (DataUpdateListener) list.elementAt(i);
               // Make a call to the method implemented by the listeners
                  // and defined in the listener interface object.
                  listener.dataUpdateOccured(event);
               System.out.println("event fired");
    public synchronized void addDataUpdateListener(DataUpdateListener listener)
         listeners.addElement(listener);
      public synchronized void removeDataUpdateListener(DataUpdateListener listener)
         listeners.removeElement(listener);
    //Display Class: creates a JFrame to display data
    public class Display extends javax.swing.JFrame
         public static void main(String args[])
              //display frame
              new Display().show();
         public Display()
         //ERROR OCCURS HERE:
         // Non-static method addDataUpdateListener (DataUpdateListener) cannot be referenced from a static context
         Data.addDataUpdateListener(new DataUpdateListener()
             public void dataUpdateOccured(DataUpdateEvent e)
                 System.out.println("Event Received!");
    //-----------------------------------------------------------

    Calling
        Data.someMethodName()is referencing a method in the Data class whose signature includes the 'static' modifier and
    might look something like this:
    class Data
        static void someMethodName() {}What you want is to add the listener to an instance of the Data class. It's just like adding
    an ActionListener to a JButton:
        JButton.addActionListener(new ActionListener()    // won't work
        JButton button = new JButton("button");           // instance of JButton
        button.addActionListener(new ActionListener()     // okay
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.*;
    public class EventTest extends JFrame
        Data data;
        JLabel label;
        public EventTest()
            label = getLabel();
            data = new Data();
            // add listener to instance ('data') of Data
            data.addDataUpdateListener(new DataUpdateListener()
                public void dataUpdateOccured(DataUpdateEvent e)
                    System.out.println("Event Received!");
                    label.setText("count = " + e.getValue());
            getContentPane().add(label, "South");
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setSize(300,200);
            setLocation(200,200);
            setVisible(true);
        private JLabel getLabel()
            label = new JLabel("  ", JLabel.CENTER);
            Dimension d = label.getPreferredSize();
            d.height = 25;
            label.setPreferredSize(d);
            return label;
        public static void main(String[] args)
            new EventTest();
    * DataUpdateEvent Class
    class DataUpdateEvent extends java.util.EventObject
        int value;
        public DataUpdateEvent(Object eventSource, int value)
            super(eventSource);
            this.value = value;
        public int getValue()
            return value;
    * DataUpdateListener Interface
    interface DataUpdateListener extends java.util.EventListener
        public void dataUpdateOccured(DataUpdateEvent event);
    * Data Class: contains data which is updated periodically.
    * Needs to notify Display frame.
    class Data
        Vector listeners;
        int count;
        public Data()
            listeners = new Vector();
            count = 0;
            new Thread(runner).start();
        private void increaseCount()
            count++;
            fireEvent(new DataUpdateEvent(this, count));
        private void fireEvent(DataUpdateEvent event)
            // Make a copy of the list and use this list to fire events.
            // This way listeners can be added and removed to and from
            // the original list in response to this event.
            Vector list;
            synchronized(this)
                list = (Vector)listeners.clone();
            for (int i=0; i < list.size(); i++)
                // Get the next listener and cast the object to right listener type.
                DataUpdateListener listener = (DataUpdateListener) list.elementAt(i);
                // Make a call to the method implemented by the listeners
                // and defined in the listener interface object.
                listener.dataUpdateOccured(event);
            System.out.println("event fired");
        public synchronized void addDataUpdateListener(DataUpdateListener listener)
            listeners.addElement(listener);
        public synchronized void removeDataUpdateListener(DataUpdateListener listener)
            listeners.removeElement(listener);
        private Runnable runner = new Runnable()
            public void run()
                boolean runit = true;
                while(runit)
                    increaseCount();
                    try
                        Thread.sleep(1000);
                    catch(InterruptedException ie)
                        System.err.println("interrupt: " + ie.getMessage());
                    if(count > 100)
                        runit = false;
    }

Maybe you are looking for

  • Removing white frame border around screenshots

    When I take a screen capture using CommandShift+4Space, the outputted image has a white background and drop shadow around the captured window. While that looks nice at first, after a while, it gets annoying. Is there a way to turn the effect off?

  • Swaps no increased in ST02

    Hi Friends, In our development system Swaps no is very high and it shows RED mark in st02 Table definition =25.213 Field definition = 357.579 Initial records = 62.209 program          =  81.856 CUA              = 12.158 Screen          = 879 please c

  • How to send by mai iweb site?

    Hy. My friend, is profesional in publicity. Can I send her by mail my iweb file so she can tell me what`s good and what`s not from what I am doing? Thank you Pd: I read in other post: Go to Library/Aplication support/Iweb. I went and there is no Iweb

  • Designer and Headstart 6 upgrade to 6i questions

    One of my customer is using Developer 6i, Designer 6.0 and Headstart 6.0 He is considering upgrading to Designer 6i and possibly Headstart 6i New features of Designer 6i are well documented on technet but what about Headstart 6i? What are the new fea

  • Is it possible to not have a disc menu?

    I want to make a dvd in which when you play it just goes straight to the movie without a disc menu...is this possible? If so, how?