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!!!

Similar Messages

  • Problems with event handling in JmenuItem

    Hello:
    I'm trying to handle an event for a menuItem and tool bar item: with this code:
    newBallotAction = new AbstractAction("newBallot")
    public void actionPerformed(ActionEvent e)
    try{
    System.out.println("MainWindow newBallotAction");
    Ballot ballot = new Ballot();
    System.out.println("MainWindow newBallotAction 2nd");
    DDNewBallotWindow ddNewBallotWindow = new DDNewBallotWindow(ballot);
    if (ballot != null) // <ballotName>, <ballotOptionsNumber> , <ballotOption1>, <ballotOption2>, .., <ballotOption(optionsNumber)>
    brothers.msgToBrothers("<Ballot>" + "<origin>" + myName + "</origin>"+ ballot.toRep() +"</Ballot>" , myName);
    else
    System.out.println("MainWindow ballot null");
    }catch(Exception f){
    System.out.println("MainWindow newBallotAction exception" + e);
    JMenuItem ballotMIDdMenu = new JMenuItem("New Ballot");
    ballotMIDdMenu = fileMenu.add(newBallotAction);
    ddMenu.add(ballotMIDdMenu);
    It produces the next exception:
    MainWindow newBallotAction exceptionjava.awt.event.ActionEvent[ACTION_PERFORMED,cmd=newBallot] on javax.swing.JMenu$2[,1,49,137x21,alignmentX=null,alignmentY=null,border=javax.swing.plaf.metal.MetalBorders$MenuItemBorder@55a338,flags=264,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=true,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=newBallot]
    It's really complex ... I'm desperado ;)
    Thanks in advance, Nacho.

    Hi,
    The exception is propably occuring in the Ballot() constructor (which you didn't post).
    And, as dukeman already mentionned, you are printing out the ActionEvent object and not the Exception itself.

  • Migration from Serial polling to Serial queue with event handler

    Hi, I am trying to migrate from classical serial polling communications to serial queue with "event handler" for the buttons pressed by the user. I have placed four while loops, one for the event handler, a second one for serial reading, a third one for serial writing (depending on what button was pressed) and the last one for processing what was read from the serial reading while loop, via a queue.
    My attached device reads the signals from 8 sensor ( 4 temperature and another 4 temperature plus humidity in the same sensor ) and send them via serial to Lavbiew.
    First of all, only once just after running the LV program, I must turn on my attached device with an ON command plus a carriage return after that the device will respond with the number of sensors plugged to it, disabling the corresponding buttons in the front panel. Then labview must wait until I pressed Acquire Button (event handler) and send a CF command plus what sensors to acquire plus a carriage return, then the device will respond continuously to labview with the sensor readings until I press the stop button (event handler), there is also another button to exit the program, also with event handler.
    I am having problems using the event handler and the queues because I am new using these structures, I have looked at  the LV examples but there is nothing concrete on using serial with event handler and queue.
    Take a look at my VI and you will soon notice what kind of problems I am having, any suggestions will welcome.
    Thank's in advance.
    Regards.
    Attachments:
    serial queue.zip ‏76 KB

    Hi Luisete,
    Maybe the problem arise because you are En- and DeQueue in parallel. You do a lot of things in parallel, that is nice if you are sure that one loop doesn't have to wait for another loop. Make sure you don't dequeue before enqueue.
    Hope this helps
    I never knew that the standard error cluster output could be wired directly to the loop control of a while loop.
    First time I see this

  • Problem with Intrastat handling (MEIS)

    Dear SCN Members,
    we have a problem with Intrastat handling:
    Our company is in Great Britain (example VAT-No. GB123456789)
    We have a vendor in Switzerland (no EU VAT-No.), who has a fiscal representative in Belgium (example VAT-No. BE1234567890).
    Both have a separate vendor number (swiss vendor: 23176, belgian vendor: 33179).
    We created a partner "WL" (Goods Supplier) in the vendor master data of the swiss vendor and assigend the belgian vendor number. The swiss vendor master data has nothing filled in the "VAT Reg. No." field (LFA1-STCEG) of the vendor master data. The belgian vendor number has the belgian VAT-No. filled in the "VAT Reg. No." field (LFA1-STCEG) of the vendor master data.
    The partner "WL" is automatically taken into the purchase order header partners and is also taken into account for the goods receipt posting.
    After I have posted the vendor invoice, the line is shown in transaction MEIS, but the incompletion log is always showing message no. EIP029:
    The system did not find the VAT registration number of vendor 23176.
    In my opinion, the VAT no. of the fiscal representative (BE1234567890) should be taken into account for the Intrastat reporting, as the swiss vendor has no VAT number. We have not yet managed to get the belgian VAT into the Intrastat report.
    Could you please clarify. Thanks in advance for your help!

    Hi,
       Please refer the KBA: 1988909 - MEIS: Error EIP 029 "The system did not find the VAT registration number of vendor The reason and the solution is well explained in the KBA. You may change the configuration as explained in the KBA and test again.
    Regards,
    AKPT

  • Enhance standard class with event handler method

    In trying to enhance a standard class with a new event handler class, I find that the ECC 6.0 EHP4 system does not appear to recognise the fact the method is an event handler method.  The specific example is a new method to handle the event CL_GUI_ALV_GRID->USER_COMMAND. 
    I notice that the flag called Active has not been ticked - see image below.  Perhaps this is the reason why the event handler is not being triggered.
    Note that there is an event handler for the same event in the standard class which obviously is executed as expected.  Any ideas on limitations in the system or I am missing a step?
    Thanks
    John

    Thank you for your replies.
    There is a bug in the ALV handler of a standard SAP class (when executed in ITS WebGUI) and I was hoping to create a custom event handler as an Enhancement to execute some custom code to sort of "handle the bug". 
    I agree - ideally it should be done in a Z class but that will not give me access to the object methods and attributes of the enhanced class.
    Cheers,
    John

  • Drop Down List in ALV with Event handler

    Hi All ,
    I have created an ALV grid with a dropdown as one of the columns. This all works fine, except that I want to be able to react to a change in the value of each line's dropdown the next column values should change according to the user selection in the 1st column .
    Is this possible?
    As an example, I have a table of records with one column as a dropdown called " Replace Function Module "   and in 2nd column i have call function of that Replace Function Module , If a  change in " Replace Function Module " should change the call function of in the 2nd column .
    I am using these objects lvc_t_drop , lvc_s_drop and  the method  " set_drop_down_table ",
    Please Can any 1 tel me how to do this with any event handler ar any other way !

    Hi,
    You need to use event handler for this. Check if the below link gives some direction.
    [http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01]
    I guess you should create a method inside which you call the FM using the FM name from the selected cell in ALV.
    I have not tried it out, but its worth a try.
    Hope this helps!
    Regards,
    Saumya

  • Problems with event import on iMovie 10.0.3

    My complete movie libraries works fine with iMovie 9.0.9. There are no other malfunctions. The filessystem is clean.
    After upgrading to iMovie 10.0.3 the initial startup event and project update process fails on serveral older events and I have problems to import this events folders.
    Why does V. 10.0.3 has problems with some older events ?  What to do to get this files properly ?
    Thanks in advance for any help.
    Alexander

    when i try to move them together this happens..?

  • EEM Applet Problem With: event syslog pattern ".*" priority 2

    I went to create a EEM applet that would be invoked whenever any syslog message of priority 0-2 was invoked. I figured  the following event statement would work
           event syslog pattern ".*" priority 2
    I never really used the priority optional argument before but thought I understood from the docs that messages at or numerically lower than the specified level are matched.
    Well it doesn't seem to work as documented.  Seems to me that only messages at the specified level are beng matched and not messages numerically lower than the specified level.
    Anyway I did what I wanted differently but wanted to post this in case this is a bug in the syslog ed.

    Actually, it's a problem with the documentation.  The priority option only matches the specified severity.  What you could do is adjust pattern to do this:
    event syslog pattern "*-[012]-"

  • Problems with SoapMessage Handler in SJS AS 8.1

    Hi!
    I try to post it in this forum as well, since there is no response in the WebService forum, and it also seems to be a problem with the application server.
    I have problems with execution of standard soap message handler.
    Both webservice and handler is of "HelloWorld" and is generated in the NetBeans 4.1 IDE and follows the standards of WebService and GenericHandler
    When I try the WebService Runtime testtool integrated in NetBeans, the handler and webservice works fine on the localhost SJS AS 8.1. Then I try to execute the same wsdl from other test environment(like soapscope) and I receive an error from the SJS AS(JAXRPC.TIE.04: Internal Server Error (JAXRPCTIE01: caught exception while handling request: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl))
    Then I try to deploy without references to the handler in the webservice.xml, and then webservice works fine.(also through soapscope).
    Is there some server settings that I have missed??
    I also have the latest build of NetBeans 4.1 and a standalone version of SunAppserver 8.1(Sun Java System Application Server Platform Edition 8.1 2005Q2 UR2)
    Stacktrace from the server:
    [#|2005-06-16T14:11:09.546+0200|WARNING|sun-appserver-pe8.1_02|javax.enterprise .system.container.web|_ThreadID=16;|preWebHandlerError
    java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl
    at com.sun.xml.rpc.server.StreamingHandler.getOpcodeForRequestMessage(StreamingHan dler.java:628)
    at com.sun.enterprise.webservice.WsUtil.getInvMethod(WsUtil.java:943)
    at com.sun.enterprise.webservice.ServletPreHandler.handleRequest(ServletPreHandler .java:55)
    at com.sun.xml.rpc.client.HandlerChainImpl.handleRequest(HandlerChainImpl.java:86)
    at com.sun.xml.rpc.server.StreamingHandler.callRequestHandlers(StreamingHandler.ja va:918)
    at com.sun.xml.rpc.server.StreamingHandler.preHandlingHook(StreamingHandler.java:8 31)
    at no.vsusdag.ws.DagWSEPSEI_Tie.preHandlingHook(DagWSEPSEI_Tie.java:236)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:102)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate. java:443)
    at com.sun.enterprise.webservice.JAXRPCServlet.doPost(JAXRPCServlet.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    |#]
    [#|2005-06-16T14:11:09.546+0200|SEVERE|sun-appserver-pe8.1_02|com.sun.xml.rpc.s erver|_ThreadID=16;|com.sun.xml.messaging.saaj.soap.impl.TextImpl
    java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl
    at com.sun.enterprise.webservice.WsUtil.throwSOAPFaultException(WsUtil.java:972)
    at com.sun.enterprise.webservice.ServletPreHandler.handleRequest(ServletPreHandler .java:68)
    at com.sun.xml.rpc.client.HandlerChainImpl.handleRequest(HandlerChainImpl.java:86)
    at com.sun.xml.rpc.server.StreamingHandler.callRequestHandlers(StreamingHandler.ja va:918)
    at com.sun.xml.rpc.server.StreamingHandler.preHandlingHook(StreamingHandler.java:8 31)
    at no.vsusdag.ws.DagWSEPSEI_Tie.preHandlingHook(DagWSEPSEI_Tie.java:236)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:102)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate. java:443)
    at com.sun.enterprise.webservice.JAXRPCServlet.doPost(JAXRPCServlet.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    |#]
    Hope someone have some tips and can help me.
    thanks
    Dag Arvola

    Hi,
    I too use SOAPScope and have faced the same problem.
    With some trial and error figured out that the problem is possibly with the way the XML string is parsed by the Message Handler classes.
    Here is the detail and hope it helps you too. The work around is to remove any white spaces / new line chars following the <Body> tag.
    Rgds, Rajasekhar
    I uploaded a SOAPScope workspace with different message invocations, with the "Message Handler" configured.
    The work space is @
    http://www.mindreef.net/tide/shared/workspace/e36d678cbb35389dd238fa16a8cdeb14
    The 1st Message is the one captured in SOAPScope, while invoked from the NetBeans IDE itself.
    If you observe the 3rd message that failed and the 4th Message that works, the only difference is the string that is posted to the Web Service URI.
    From Resend > Preview Edit
    3rd Message is a properly formatted xml document with the third line reading as just
    <soap:Body>
    where as
    4th Message is not a properly formatted xml document with the third line reading as
    <soap:Body><mrns0:createCustomer>
    Even a <Space> as in "<soap:Body> <mrns0:createCustomer>" causes a SOAP Fault to occur.
    *********************

  • Stopped dead with event handling

    ive made a program that has one button, two radio buttons, and a text field....when u click on the radio button is either paints a square or a circle to the screen...im having problems with tieing the textfield and the button..which is called "Enter" together....the point is to read numbers out of the textfield..and change the image size when the user hits enter...ive been working on this for some time...if anyone can possibly help me out, point me in a direction..anything, id be in your debt. Thanks...
    /***************************first part - main execution of applet******/
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Medium extends JApplet {
         private JButton enterButton;
         private JTextField textField;
         private JPanel buttonPanel;
         ButtonGroup group;
         JRadioButton circle;
         JRadioButton square;
         Label textfieldLabel;
         private DrawPanel drawingPanel;
         public void init() {
              drawingPanel = new DrawPanel();
              drawingPanel.setBackground( Color.black );
              enterButton = new JButton( "Enter" );
              enterButton.setBackground( Color.red );
              enterButton.addActionListener(
                   new ActionListener() {
                        public void actionPerformed( ActionEvent event ) {
                             drawingPanel.enterButtonMethod();
              textField = new JTextField( 10 );
              textField.setBackground( Color.red );
              textField.addActionListener (
                   new ActionListener() {
                        public void actionPerformed( ActionEvent event ) {
                             if( event.getText() ==
              circle = new JRadioButton( "Circle" );
              circle.setMnemonic( KeyEvent.VK_C );
              circle.addItemListener(
                   new ItemListener() {
                        public void itemStateChanged( ItemEvent event ) {
                             if( event.getStateChange() == ItemEvent.SELECTED )
                                  drawingPanel.showCircle();
                             else     if( event.getStateChange() == ItemEvent.DESELECTED )
                                       drawingPanel.selectorEqualsFalse();
              square = new JRadioButton( "Square" );
              square.setMnemonic( KeyEvent.VK_S );
              square.addItemListener(
                   new ItemListener() {
                        public void itemStateChanged( ItemEvent event ) {
                             if( event.getStateChange() == ItemEvent.SELECTED )                    
                                  drawingPanel.showSquare();
                             else     if( event.getStateChange() == ItemEvent.DESELECTED )
                                       drawingPanel.selectorEqualsFalse();
              textfieldLabel = new Label( "Change Object Size:" );
              textfieldLabel.setBackground( Color.red );
              group = new ButtonGroup();
              group.add( square );
              group.add( circle );          
              buttonPanel = new JPanel();
              buttonPanel.setLayout( new GridLayout( 2, 3 ) );
              buttonPanel.add( enterButton );
              buttonPanel.add( textfieldLabel );
              buttonPanel.add( textField );
              buttonPanel.add( circle );
              buttonPanel.add( square );
              Container container = getContentPane();
              container.add( buttonPanel, BorderLayout.SOUTH );
              container.add( drawingPanel, BorderLayout.CENTER );
              setSize( 400, 400 );
              setVisible( true );
    /*************************DrawPanel.java - 2nd part of applet******/
    import java.awt.*;
    import javax.swing.*;
    class DrawPanel extends JPanel {
         private int selector = 0;
         private int SQUARE = 1, CIRCLE = 2;
         private int sizeModifier = 50;
         public void paintComponent( Graphics g ) {
              super.paintComponent( g );
              if( selector == SQUARE ) {
                   g.setColor( Color.red );
                   g.fillRect( 50, 10, sizeModifier, sizeModifier );
              else     if( selector == CIRCLE ) {
                        g.setColor( Color.green );
                        g.fillOval( 50, 10, sizeModifier, sizeModifier );
              else     if( selector == 0 ) {
                        g.setColor( Color.white );
                        g.drawString( "Yo Yo, Brotha, do some selections man!", 50, 50 );
         public void enterButtonMethod() {          
              this.repaint();
         public void textFieldMethod() {
              this.repaint();
         public void showCircle() {
              selector = 2;
              this.repaint();
         public void showSquare() {
              selector = 1;
              this.repaint();          
         public void selectorEqualsFalse() {
              selector = 0;
              this.repaint();
    }

    nevermind i figured it out...it seems that i had to get ride of the second class and add it to the first file...then u wouldn't have to send an object to receive methods from DrawPanel...and the enter button just had to called with the sizemodifier to change the size and also to setText() in the textField area......"Its the small things in life that kill u......"
    if anyone has any feed back on my code please feel free to rip it open..

  • Problem in event handling using oo abap code

    Hi,
    My requirement is i need to disply 3 blocks in ALV format.I have done that.Now my problem is if i double click on aufnr of the first block, it should call the transaction code. I have written the code in oo abap but i have used function modules for ALV.Now my doubt is 'How to write an event  once the user double click on the particular field of the first block, it should call the tcode " using object oriented code.
    How to populate the heading for each block using oo abap code.
    Thanks & Regards
    Anus

    hi.....
    Use Double_click event handler method of class cl_gui_alv_grid of first block....
    if not solved .
    Send me Your program lines ...........
    Best Regards
    Prabhakar

  • Problems with events in flex

    Hi there. I'm a AS2 and Flash CS3 guy. I started to learn AS3 and transfer to Flex 3. But I got a problem w/ Events in AS3. I'm adding a canvas component to the stage. On that canvas, I added 3 different events: mouse down, mouse move, and mouse up. When mouse move is fired, there is no way for me to get mouse up event fired, and viceversa, when mouse up is fired, there is no way to get the mouse move event fired. Is there any one to help this newbie with this particular problem? Any help will be very appreciated.
    Code:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:canvas id="myCanvas" x="50" y="50" width="500" height="500" click="event_1();" mouseMove="event_2();" mouseUp="event_3();">
    </mx:Canvas>
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import flash.events.*;
    public function event_1():void
    { Alert.show("First event fired"); }
    public function event_2():void
    { Alert.show("Second event fired"); }
    public function event_3():void
    { Alert.show("third event fired); }
    </mx:Script>
    </mx:Application>

    Hi Greg. Thank you for your replay. The question is I didnt want to bother you with the complete code and post it with the minimal expression. But here I give you the full code w/corresponding package. What I'm trying to do is drawing a line over an empty canvas (I got it very easily in Flash AS2)
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="addChild(p1)">
    <mx:Canvas id="wrapper" x="10" y="10" width="600" height="600">
      <mx:Canvas x="50" y="50" width="500" height="500" id="imageView" backgroundColor="#F8F3F3" click="startDraw();" mouseMove="drawLine();" mouseUp="noDrawLine();" >
      </mx:Canvas>
    </mx:Canvas>
    <mx:Button x="263" y="618" label="Draw Line" click="prepToDraw();"/>
    <mx:Script>
    <![CDATA[
      import com.myDomain.Lines.Main;
       import mx.graphics.*;
       import mx.binding.utils.BindingUtils;
       import flash.events.IOErrorEvent;
       import flash.events.Event;
       import flash.display.*;
       import mx.controls.Alert;
       import com.myDomain.Lines.Main;
       public var p1:Main = new Main();
       public var pre:Number = 0;
       public function prepToDraw():void
        pre = 1;
       public function startDraw():void
        if(pre == 1)
        p1.graphics.clear();
        var newColor:int = 0xFF00FF;
        var iniX:Number = mouseX;
        var iniY:Number = mouseY;
        var lineWidth:Number = 10;
        p1.graphics.lineStyle(lineWidth, newColor);
        p1.graphics.moveTo(iniX, iniY);
       public function drawLine():void
        if(pre == 1)
         p1.graphics.lineTo(mouseX, mouseY);
       public function noDrawLine():void
        if(pre == 1)
         Alert.show("noLine");
    ]]>
    </mx:Script>
    </mx:Application>
    The package:
    package com.myDomain.Lines
    import flash.display.Shape;
    import flash.display.Stage;
    import flash.events.MouseEvent;
    import mx.core.UIComponent;
    public class Main extends UIComponent
      public function Main()
       super();
      public var p1:Shape = new Shape();
    If you go apply the code, you will see: 1) The first event to fire is mouseUp, then you eill start drawing the line, but again, you will not be able to stop this event with mouseUp. If you can help me, I will be very appreciated. Thanks. 

  • Problem with Events Manager: 'slct'

    I set up an Events Manager item to run a script whenever the event "Selection" ( 'slct' ) is activated. The script works beautifully and I'm having no problem with the script itself. I am, however, having problems with what happens after the script finishes. I have this problem even if I completely comment out the script or delete everything inside the script file and leave it blank. The purpose of the script is to automate things when I select specific layers. That works and the script has some checks to prevent anything from happening unless one of those specified layers is selected.
    The problem is, when I select a tool using the keyboard shortcuts, it will revert back to the previous tool upon the next keypress. It basically acts as if I am using toggle mode for that tool by holding down the key for that tool.
    I wiped out my preferences but that did not solve the problem. It makes no difference how my keyboard shortcuts are mapped...either default or user defined. So for an example, here is how some of my keys are mapped:
    B-Paintbrush tool
    S-Brush Size Increase
    So if I'm using the Clone Stamp tool and want to switch to the Paintbrush tool, I will press the "B" key. The tool switches as it's supposed to. If I need to change the size or hardness of the brush, I press one of the corresponding keys...let's say "S" to increase size. When I press "S" nothing will happen until I release that key. Once I do release it, the tool switches back to the Clone Stamp tool. You can get this same effect yourself if you hold down the key of the tool you are switching to (use the toggle mode) and then try to change size/hardness using the keyboard shortcut for that function while still holding that tool's key down.
    If I select the tool from the Tools Palette, I do not have this problem. If the tool is selected from within my script, I do not have this problem. The only time I have this problem is when using the keyboard shortcuts to select the tool.
    Keep in mind that I have tried this with the script code completely bypassed/erased so no script code actually exedutes. When I turn of the Events Manager or remove the 'slct' item from Events Manager, I do not have this problem at all. If I hold the <SHIFT> key down while selecting the tool, I do not have this problem (this is the same as if you were to hold down the <SHIFT>+<tool key> and press the key to change size/hardness).
    To me, it seems as though if there is a 'slct' event item in Events Manager and the keyboard is used to select a tool, Photoshop treats it as if that key is being held down (toggled) until another key is pressed (or even the same key).
    If anyone knows how to get around this problem, I would greatly appreciate it. Thank you.

    I'm having the same problem where a keystroke (like changing size "[ or "]") will revert to a previous tool rather than change size. Particularly annoying when you left your previously selected eraser slightly larger or smaller than your brush size and don't realize it till you've erased.
    So far, from reading across quite a number of forums, it seems the event listener istelf causing the issue
    At the moment I've just been thinking of "BB" as my shortcut instead of "B" so when it reverts it reverts back to the brush anyway.
    I'll come back if I find a real solution to this annoyance ;P
    CS5
    Wacom Intuos4
    Windows7

  • Need Help with Event Handler Code - Doesnt come up in Event Handler Manager

    Hello there,
    Below is the code snippet that I am using to create a event handler:
    package com.oracle.events;
    import com.thortech.util.logging.Logger;
    import com.thortech.xl.client.events.tcBaseEvent;
    import com.thortech.xl.dataobj.tcDataObj;
    import com.thortech.xl.util.logging.LoggerModules;
    public class tcCheckOvrallProvStatusUDFs extends tcBaseEvent
         private static Logger logger = Logger.getLogger(LoggerModules.XL_JAVA_CLIENT);
         public tcCheckOvrallProvStatusUDFs()
              setEventName("Generating tcCheckOvrallProvStatusUDFs");
    * @Override
    * @throws Exception
         protected void implementation() throws Exception {
              tcDataObj data = getDataObject();
              String OIDProvStatus = data.getString("usr_udf_oidusrprovstatus");
    String EBSProvStatus = data.getString("usr_udf_ebstcausrprovstatus");
              if (OIDProvStatus.equals("Provisioned") && EBSProvStatus.equals("Provisioned")) {
                   setOverAllProvStatus(data);
         * @param data
         * @throws Exception
         private void setOverAllProvStatus(tcDataObj data) throws Exception
              data.setString("usr_udf_ovrrscprovstatus", "Provisioned");
    Its a simple code that I am using to populate value of a UDF field depending on the value of other 2 fields. I want to trigger it on Post-Insert and Post-Update events.
    But even if I restart the OIM server after placing the successfully compiled file (0 errors, 0 warnings) into the EventHandlers folder of OIM_HOME; it doesnt show up in the Design Console -> Development Tools -> Business Rule Definition -> Event Handler Manager. :( In order to create a event handler i need that file to show up in the lookup of event handlers/adapters. This JAR file doesnt come up over there.
    Is there anything missing within the code ?
    What else needs to be specified?
    Please provide some guidance.
    Thanks,
    - jhb.

    Now I have placed this JAR file in JAVATasks folder - made an entity adapter - in the event handler manager - i gave the class name/event handler name as 'setUDFValue' and the package as 'project5'. But now im getting it 'DOBJ.EVT_NOT_FOUND - Event Handler not found' error.
    package project5;
    import java.util.Hashtable;
    import Thor.API.Exceptions.tcAPIException;
    import java.util.Hashtable;
    import java.util.HashMap;
    import com.thortech.xl.util.config.ConfigurationClient;
    import Thor.API.tcResultSet;
    import Thor.API.tcUtilityFactory;
    import Thor.API.Operations.tcUserOperationsIntf;
    import java.lang.System;
    import Thor.API.Exceptions.tcUserNotFoundException;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class setUDFValue {
    private static final String SMTP_HOST_NAME="mail.smtp.host";
    public setUDFValue() {
    // public static void main(String[] args) {
    // setUDFValue.setvalue("jatinbhatt");
    // setUDFValue.sendemail("[email protected]","[email protected]");
    public static void setvalue(String UserID) {   
    try
    System.setProperty("XL.HomeDir", "F:/oim/oimserver/xellerate");
    System.setProperty("log4j.configuration",
    "F:/oim/oimserver/xellerate/config/log.properties");
    System.setProperty("java.security.policy",
    "F:/oim/oimserver/xellerate/config/xl.policy");
    System.setProperty("java.security.auth.login.config",
    "F:/oim/oimserver/xellerate/config/auth.conf");
    System.out.println("Startup...");
    System.out.println("Getting configuration...");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    System.out.println("Login...");
    Hashtable env = config.getAllSettings();
    tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","oimadmin1");
    System.out.println("Getting utility interfaces...");
    tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    HashMap userMap = new HashMap();
    String str1 = null;
    String str2 = null;
    userMap.put("Users.User ID",UserID);
    userMap.put("Users.Status", "Active");
    tcResultSet userResultSet = null;
    try {
    userResultSet = moUserUtility.findAllUsers(userMap);
    } catch (tcAPIException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    for (int i=0; i<userResultSet.getRowCount(); i++)
    userResultSet.goToRow(i);
    str1 = userResultSet.getStringValue("USR_UDF_OIDUSERPROV");
    str2 = userResultSet.getStringValue("USR_UDF_EBSUSERPROV");
    // System.out.println(userResultSet.getStringValue("USR_UDF_OIDUSERPROV"));
    // System.out.println(userResultSet.getStringValue("USR_UDF_EBSUSERPROV"));
    if (str1.equals("Provisioned") && (str2.equals("Provisioned") || str2.equals("NA")))
    userMap.put("USR_UDF_OVRRSCPROVSTATUS","Provisioned");
    moUserUtility.updateUser(userResultSet,userMap);
    moUserUtility.close();
    }catch (Exception e){
    e.printStackTrace();
    ERROR:
    ERROR RMICallHandler-63 XELLERATE.SERVER - Class/Method: tcDataObj/ runEvent encounter some problems: project5.setUDFValue
    java.lang.ClassCastException: project5.setUDFValue
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.eventPostUpdate(Unknown Source)
         at com.thortech.xl.dataobj.tcUSR.eventPostUpdate(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(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:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SecurityRoleInterceptor.invoke(SecurityRoleInterceptor.java:47)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at tcUserOperations_RemoteProxy_6ocop18.updateUser(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:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Thanks,
    - jhb.

  • Having problem with Event function in Photostream

    Since the upgrade I find that the event function is no longer separating my uploaded photos by date of taking them so they are now all in one bucket so to speak instead of each day of the holiday. Why has this happened and have others had a similar issues? 

    Hi Markus,
    If I understand it correctly then you have a dropdown box and on the basis of value selected in dropdown box you need to filter the records displayed in the table view below...
    If this is the requirement then you will have to write your custom code to filter data. For your dropdown field redefine get_p_xxxx to add a server event once the value is selected in dropdown box.
    Please refer to:
    Re: Tableview - get changed data event???
    Since server round trip would be triggered you can loop on data from your context and filter it in do_prepare_output or else you can create your event handler as well...
    e Regards,
    Bhushan

Maybe you are looking for

  • HT204053 lost iPhone and can't locate it on find my iPhone

    I accidentally erased one of my iPhones from the find my iPhone list. I have lost this phone how do I get it back on the list?

  • Flash CS4 presentation slideshow. help!

    Hello everyone! I need help creating a presentation slideshow in Flash CS4 for an online course with many slides. The outlook is that it would look and work very much like power point except that it will be done through Flash CS4 and uploaded online.

  • Kicked out of the program IMovie

    Constainly i get kicked out of the program Imovie in Ilife 08!!! during importing films etc... Who can give me an answer why?????

  • Invalid tables during DMO procedure

    In my BW migration from Oracle to SAP Hana, I have some invalid tables. Per SAP Guide page 56: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/308e6779-5007-3110-998a-e117ef964a47?QuickLink=index&- (www.sdn.sap.com/irj/scn/go/porta

  • Service order as followup document for service order

    HI gurus, Can a service order be created as a followup for service ticket. The call agent creates a service ticket for a channel partner. The channel partner should open the service ticket and create a followup document service order for the service