Question about event handling in a button

I recently coded a console version of my java program (just outputs stuff into the system console and a logger). I am now adding a simple GUI with a set of buttons to start and stop the program. In order to do this, do I just copy paste the main function contents of the console version of my code into the button's event handlers or is there a way I can just run the main class? I was googling for Class loading in java but I'm not sure if this is what I should be looking at... Can someone please help me out?

MyMainClass.main(new String[] { "the", "arguments" });
// or, if you defined your main to use varags (i.e. as "public static void main(String... args)") then you can just use
MyMainClass.main("the", "arguments");But you should really extract your functionality out of the main method into meaningful classes and methods and just use those from both your console code and your GUI code.

Similar Messages

  • Question about event handling in JComponents

    I have often found it useful to create a component that acts as an event handler for events the component generates itself. For example, a panel that listens for focus events that effect it and handle these events internally. (See below).
    My question is: Can this practice cause synchronization issues or any other type of problem that I need to watch out for? Is it good/bad or neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff
    }

    Hi,
    Handling events this way is completely fine and saves on number of classes. Only thing you may want to watch out for is that the handler methods have to be public. This means that someone could use your component and call one of the methods. For example, I could write:
    panel.focusGained(new FocusEvent(....))
    when it's not really gaining focus. So, if you're writing this component for re-use you might want to be aware of this.
    An alternative:
    Use a single internal class to handle all events. It can then delegate to private methods of your component. Example:
    class MyEventHandler implements FocusListener, MouseListener, etc... {
    public void focusGained(FocusEvent fe) {
    doFocusGained(fe);
    public void mousePressed(MouseEvent me) {
    doMousePressed(me);
    Then your component could have:
    private void doFocusGained(FocusEvent fe) {
    private void doMousePressed(MouseEvent me) {
    etc...
    Just ideas :)
    Thanks!
    Shannon Hickey (Swing Team)
    I have often found it useful to create a component
    that acts as an event handler for events the component
    generates itself. For example, a panel that listens
    for focus events that effect it and handle these
    events internally. (See below).
    My question is: Can this practice cause
    synchronization issues or any other type of problem
    that I need to watch out for? Is it good/bad or
    neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements
    FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff

  • How to find event handler for save button in salesorders

    Hi,
    I want perform event based on save button in salesorders.Can you tell me how to find the event handler for
    save button.
    Regards,
    Brahmaji

    Brahma,
    you can find the component, view details by doing an F2.
    open the component, the view will be mostly an overview page i.e., the name ends OP etc.,
    But your method name will be mostly EH_ONSAVE, you need to find exact view.
    F2 does not come up properly for overview pages, you have to look into UI config tool preview and make sure sometimes.
    Regards,
    Masood Imrani S.

  • Question on program structure about event handling in nested JPanels in GUI

    Hi All,
    I'm currently writing a GUI app with a wizard included in the app. I have one class that acts as a template for each of the panels in the wizard. That class contains a JPanel called contentsPanel that I intend to put the specific contents into. I also want the panel contents to be modular so I have a couple of classes for different things, e.g. name and address panel, etc. these panels will contain checkboxes and the like that I want to event listeneres to watch out for. Whats the best way of implementing event handling for panel within panel structure? E.g for the the checkbox example,would it be a good idea to have an accessor method that returns the check book object from the innerclass/panel and use an addListener() method on the returned object in the top level class/panel. Or is it better to have the event listeners for those objects in the same class? I would appreciate some insight into this?
    Regards!

    MyMainClass.main(new String[] { "the", "arguments" });
    // or, if you defined your main to use varags (i.e. as "public static void main(String... args)") then you can just use
    MyMainClass.main("the", "arguments");But you should really extract your functionality out of the main method into meaningful classes and methods and just use those from both your console code and your GUI code.

  • Unable to get automatic event handling for OK button.

    Hello,
    I have created a form using creatobject. This form contains an edit control and Search, Cancel buttons. I have set the Search buttons UID to "1" so it can handle the Enter key hit event. Instead its caption changes to Update when i start typing in the edit control and it does not respond to the Enter key hit. Cancel happens when Esc is hit.
    My code looks like this -
    Dim oCreationParams As SAPbouiCOM.FormCreationParams
            oCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
            oCreationParams.UniqueID = "MySearchForm"
            oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
                    Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.AddEx(oCreationParams)
    oForm.Visible = True
    '// set the form properties
            oForm.Title = "Search Form"
            oForm.Left = 300
            oForm.ClientWidth = 500
            oForm.Top = 100
            oForm.ClientHeight = 240
            '// Adding Items to the form
            '// and setting their properties
            '// Adding an Ok button
            '// We get automatic event handling for
            '// the Ok and Cancel Buttons by setting
            '// their UIDs to 1 and 2 respectively
            oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Search"
            '// Adding a Cancel button
            oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 75
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Cancel"
    oItem = oForm.Items.Add("NUM", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 105
            oItem.Width = 140
            oItem.Top = 20
            oItem.Height = 16
            Dim oEditText As SAPbouiCOM.EditText = oItem.Specific
    What changes do i have to make to get the enter key to work?
    Thanks for your help.
    Regards,
    Sheetal

    Hello Felipe,
    Thanks for pointing me to the correct direction.
    So on refering to the documentation i tried out a few things. But I am still missing something here.
    I made the following changes to my code -
    oForm.AutoManaged = True
    oForm.SupportedModes = 1 ' afm_Ok
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Visible, 1, SAPbouiCOM.BoModeVisualBehavior.mvb_Default)
            oButton = oItem.Specific
            oButton.Caption = "OK"
    AND
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.AffectsFormMode = False
    I get the same behaviour OK button changes to update and enter key does not work.
    Could you please tell me find what is it that i am doing wrong?
    Regards,
    Sheetal

  • [JS] Basic question about event listeners and event handlers

    I am very new to the whole topic of event listeners and event handlers.  I'd run the test for the following problem myself, but I don't know where to start, and I just want to know if it's impossible -- that is, if I'm misunderstanding what event listeners and event handlers do.
    Say I have an InDesign document with a text frame that is linked to an InCopy story.  Can I use an "afterImport" event listener on the text frame to perform some action any time the link to the InCopy story gets updated?  And will the event handler have access to both the story that is imported, and the pathname of the InCopy file?
    Thanks.

    Thank you, Kasyan.
    Both of those are good solutions.
    We are currently using InDesign CS4 and InCopy CS5.  I'm hoping to get them to purchase the whole CS5 suite soon, since I'd like to start writing scripts for InDesign CS5 as soon as possible, as long as I'm going to have to be doing it in the not too distant future anyway.  The greater variety of event handlers sounds like it might be something that is crucial to the project I'm working on, so that adds to the argument for getting CS5.
    Thanks again.  You have no idea how helpful this is.  I made some promises to my boss yesterday that I later realized were  based on assumptions of mine about the InDesign/InCopy system that didn't make any sense, and I was going  to have to retract my promises.  But after reading your response I think I can still deliver, in a slightly different way that I had been thinking before.
    Richard

  • About Event Handling in user Defined Form (In Addon)

    Hi Every One,
    Can Anyone Give Me Notes On EventHandling in forms That are Disgened using Sdk UIAPI .Like Button event ,application event, menuevent... etc with saple code
    Regards
    Srinivas

    Hi Sura,
    Hope this helps. C# sample code.
    //   SAP MANAGE UI API 2005 SDK Sample
    //   File:      CatchingEvents.cs
    //   Copyright (c) SAP MANAGE
    //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
    //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
    //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
    //  PARTICULAR PURPOSE.
    //  BEFORE STARTING:
    //  1. Add reference to the "SAP Business One UI API"
    //  2. Insert the development connection string to the "Command line argument"
    //  1.
    //     a. Project->Add Reference...
    //     b. select the "SAP Business One UI API 2005" From the COM folder
    //  2.
    //      a. Project->Properties...
    //      b. choose Configuration Properties folder (place the arrow on Debugging)
    //      c. place the following connection string in the 'Command line arguments' field
    //  0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
    using System;
    using System.Windows.Forms;
    class CatchingEvents  {
        //  This parameter will use us to manipulate the
        //  SAP Business One Application
        private SAPbouiCOM.Application SBO_Application;
        private void SetApplication() {
            //  Use an SboGuiApi object to establish connection
            //  with the SAP Business One application and return an
            //  initialized appliction object
            SAPbouiCOM.SboGuiApi SboGuiApi = null;
            string sConnectionString = null;
            SboGuiApi = new SAPbouiCOM.SboGuiApi();
            //  by following the steps specified above, the following
            //  statment should be suficient for either development or run mode
            sConnectionString = System.Convert.ToString( Environment.GetCommandLineArgs().GetValue( 1 ) );
            //  connect to a running SBO Application
            SboGuiApi.Connect( sConnectionString );
            //  get an initialized application object
            SBO_Application = SboGuiApi.GetApplication( -1 );
        public CatchingEvents() {
            //  set SBO_Application with an initialized application object
            SetApplication();
            // events handled by SBO_Application_AppEvent
            SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler( SBO_Application_AppEvent );
            // events handled by SBO_Application_MenuEvent
            SBO_Application.MenuEvent += new SAPbouiCOM._IApplicationEvents_MenuEventEventHandler( SBO_Application_MenuEvent );
            // events handled by SBO_Application_ItemEvent
            SBO_Application.ItemEvent += new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler( SBO_Application_ItemEvent );
            // events handled by SBO_Application_ProgressBarEvent
            SBO_Application.ProgressBarEvent += new SAPbouiCOM._IApplicationEvents_ProgressBarEventEventHandler( SBO_Application_ProgressBarEvent );
            // events handled by SBO_Application_StatusBarEvent
            SBO_Application.StatusBarEvent += new SAPbouiCOM._IApplicationEvents_StatusBarEventEventHandler( SBO_Application_StatusBarEvent );
        private void SBO_Application_AppEvent( SAPbouiCOM.BoAppEventTypes EventType ) {
            //  the following are the events sent by the application
            //  (Ignore aet_ServerTermination)
            //  in order to implement your own code upon each of the events
            //  place you code instead of the matching message box statement
            switch ( EventType ) {
                case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
                    SBO_Application.MessageBox( "A Shut Down Event has been caught" + Environment.NewLine + "Terminating Add On...", 1, "Ok", "", "" );
                    //  Take care of terminating your AddOn application
                    System.Windows.Forms.Application.Exit();
                    break;
                case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
                    SBO_Application.MessageBox( "A Company Change Event has been caught", 1, "Ok", "", "" );
                    //  Check the new company name, if your add on was not meant for
                    //  the new company terminate your AddOn
                    //     If SBO_Application.Company.Name Is Not "Company1" then
                    //          Close
                    //     End If
                    break;
                case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
                    SBO_Application.MessageBox( "A Languge Change Event has been caught", 1, "Ok", "", "" );
                    break;
        private void SBO_Application_MenuEvent( ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent ) {
            //  in order to activate your own forms instead of SAP Business One system forms
            //  process the menu event by your self
            //  change BubbleEvent to False so that SAP Business One won't process it
            BubbleEvent = true;
            if ( pVal.BeforeAction == true ) {
                SBO_Application.SetStatusBarMessage( "Menu item: " + pVal.MenuUID + " sent an event BEFORE SAP Business One processes it.", SAPbouiCOM.BoMessageTime.bmt_Long, true );
                //  to stop SAP Business One from processing this event
                //  unmark the following statement
                //  BubbleEvent = False
            else {
                SBO_Application.SetStatusBarMessage( "Menu item: " + pVal.MenuUID + " sent an event AFTER SAP Business One processes it.", SAPbouiCOM.BoMessageTime.bmt_Long, true );
        private void SBO_Application_ItemEvent( string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent ) {
            //  BubbleEvent sets the behavior of SAP Business One.
            //  False means that the application will not continue processing this event.
            BubbleEvent = true;
            if ( pVal.FormType != 0 ) {
                //  the message box form type is 0
                //  I chose not to deal with events triggered by a message box
                //  every event will open a message box with the event
                //  name and the form UID how sent it
                SAPbouiCOM.BoEventTypes EventEnum = 0;
                EventEnum = pVal.EventType;
                // To prevent an endless loop of MessageBoxes,
                // we'll not notify et_FORM_ACTIVATE and et_FORM_LOAD events
                if ( ( EventEnum != SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE ) & ( EventEnum != SAPbouiCOM.BoEventTypes.et_FORM_LOAD ) ) {
                    SBO_Application.MessageBox( "An " + EventEnum.ToString() + " has been sent by a form with the unique ID: " + FormUID, 1, "Ok", "", "" );
        private void SBO_Application_ProgressBarEvent( ref SAPbouiCOM.ProgressBarEvent pVal, out bool BubbleEvent) {
            SAPbouiCOM.BoProgressBarEventTypes EventEnum = 0;
            EventEnum = pVal.EventType;
            BubbleEvent = true;
            SBO_Application.MessageBox( "The event " + EventEnum.ToString() + " has been sent", 1, "Ok", "", "" );
        private void SBO_Application_StatusBarEvent( string Text, SAPbouiCOM.BoStatusBarMessageType MessageType ) {
            SBO_Application.MessageBox( @"Status bar event with message: """ + Text + @""" has been sent", 1, "Ok", "", "" );
    Regards,
    Jay.

  • Event Handling for HTMLB Buttons

    Dear Pros,
    How we handle HTMLB Button Events for the following Code in the Layout section:
    I want the user to Click this button for Downloading the Internal table displayed onto an Excel file on Presentation Server.
    <htmlb:content design="classic" >
      <htmlb:page title="page1 " >
        <htmlb:form>
          <htmlb:button id = "Dwd_Excl"
             text          = "Download to Excel"
             tooltip       = "Please click for Excel Download"
             onClientClick = "EXCEL"
             design        = "small"
             width         = "200" />
          <htmlb:tableView id          = "tv1"
                       headerText      = "Sales Statement"
                       design          = "alternating"
                       headerVisible   = "true"
                       visibleRowCount = "20"
                       selectionMode   = "lineEdit"
                       table           = "<%= t_zsstable %>"
                       iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Waiting for your suggestions/replies.
    Sincere Thanks to All.
    Vivek Singh.

    Hi Craig,
    Just worked on the code sample you provided. Heres' how my code looks in OnInputProcessing segment:
          Some internal table population code here
    then the following code segment:
    file = 'C:\ZSS.XLS'.
    event = cl_htmlb_manager=>get_event_ex( request ).
    IF event IS NOT INITIAL AND event->event_id = 'Dwd_Excl'.
      results = 'Button was pushed'.
    ENDIF.
    IF results = 'Button was pushed'.
      CALL FUNCTION 'WS_EXCEL'
        EXPORTING
          filename      = file
        TABLES
          data          = t_zsstabl
        EXCEPTIONS
          unknown_error = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    The problem is that when I push the Download to Excel HTMLB Button, the following Error is being displayed on the page :
    500 SAP Internal Server Error
    Error message: Exception condition "NO_BATCH" raised. ( type of termination: RABAX_STATE )
    The Layout part code is :
    <htmlb:content design="classic" >
      <htmlb:page title="page1 " >
        <htmlb:form>
          <htmlb:button id            = "Dwd_Excl"
                        text          = "Download to Excel"
                        tooltip       = "Please click for Excel Download"
                        onClick       = "ExcelButton"
                        design        = "small"
                        width         = "200" />
          <htmlb:tableView id              = "tv1"
                           headerText      = "Sales Statement"
                           design          = "alternating"
                           headerVisible   = "true"
                           visibleRowCount = "20"
                           selectionMode   = "lineEdit"
                           table           = "<%= t_zsstabl %>"
                           iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    I hope you can suggest something on this.
    Waiting for your response.
    Best Regards,
    Vivek.

  • Question about displaying handler errors in the webdynpro

    Hello all, Please forgive any EM terminology mixups as I am new to this unique module!
         Here is my scenario, I am in EM WebDynpro and updating the actual dates on a purchase req. The event handler accepts the date I entered and in the background makes a synchronous rfc call to ECC to update the related project with the new date. This rfc call fails because I have the project open and it is locked. This call is synchronous so I get the error right away and I set the return code to 4 and populate an error message that I want passed back to the user in WebDynpro. For some reason the EM system is ignoring this error and returning to the user a successful 'sent' message.
    EM WebDynpro --> Purchase Req --> PO Approved Actual Date entered --> synchronous RFC to ECC to update Project --> project locked error returned by ECC --> error message populated in EM --> EM WebDynpro returns as if it was successful
    I have put in breakpoints to ensure I was populating error messages back to EM and I see the details flowing back that are correct, but no details are returned to the actual user. If I go to the Event Handler Overview in the GUI I can find my error message recorded there. Problem is our users will be working from the Web primarily and would not see this message in a normal course of work.
    Is there a config piece that I should be setting to return this error to the users in WebDynpro? This seems like a trivial/standard piece of functionality so I am confused as to why it is not showing up in the dynpro.
    Thank you for any help or ideas and points awarded of course!
    John

    Hello Berthold,
       I believe we understand what you are saying we should do and we have mimicked the activity you described. Now we are running into a short dump when the system tries to process the RETRIEVE MSG method. The code is looking for the class /AIN/CLPUB_ID_CONVERT for some reason. This class does not exist in this release. There is a /SAPTRX/ class that matches.
    So in /SAPTRX/CL_PUB_ID_CONVERT method CALL_AII_FOR_SINGLE_ID at line 45 there is this statement:      CALL METHOD (co_ain_class_name)=>(co_ain_method_id_mapping). Since this is a dynamic class/method call we think we must have something still incorrect in the IMG so we are going through troubleshooting and looking at OSS Notes. No luck so far.
    Any additional input or ideas as to possible missed steps would be greatly appreciated.
    John
    PS Release 7 (SAPK-70004INSCEMSRV pack level)
    Edited by: John D Norman on May 6, 2010 2:00 AM

  • About event handler

    hi
    i am trying to develop a event handler for all the attributes of a resource that when user is modified is attributes. he need get a notification that paritcular attribute or u r data is modified..
    actually i have seen that they have return adapter for each attribute but dont want so many adapters to be writtten so i want to develop a event handler for that scenario... please provide the sample code so that i can modifie or re coding it....
    thanks
    avinash

    Hi,
    I had created one dissconnected resource and one application form for it... the user had filled the form of that resource and submitted and when he want to update the form once again the event handler should be tirrger and paritcular attribute should be update and he had to send email notification that attribute is changed...
    here is once thing that if he had change numberof attributes at a time but we have to send only one email notification for all the attributes...
    regards
    avinash

  • UIX-XML BC4J Question regarding event handling

    How can I use/access Application Module, defined in UIX-XML page (using <bc4j:registryDef>), in my event handler method ???

    Sorry for the confusion. I figured out what you were asking.
    The right way is this.
    First, in your UIX XML page, declare your handler like this:
    <event name="%myEvent%" >
    <bc4j:findRootAppModule name="%ModuleName%" >
    <method class="%eventclass%" method="%eventmethod%" />
    </bc4j:findRootAppModule>
    </event>
    the strings in the % have to be replaced with your own particular names. %ModuleName% should be the same as the name of the module in the registry.
    Then in the event handler %eventclass%.%eventmethod% you can use this to find the Application Module:
    oracle.jbo.ApplicationModule mymodule
    = oracle.cabo.data.servlet.bind.ServletBindingUtils.getApplicationModule(context);
    "context" is passed in to your event handler as a BajaContext. ServletBindingUtils has several other methods for getting BC4J stuff, you should look at its definition.
    Joe

  • A question about how to change a button in a JPanel during runtime

    I am a beginner of GUI. Now I am trying to change a specific component, a button, when the application is running. For example, I have 3 buttons in a JPanel. Each button has its onw icon. If I click one of them, it will change its icon, but the other two don't change. I don't know if there is any method for changing a specific component during runtime. If any one knows please let me know, I will appreciate that very much!!!

    What you're going to have to do is loop inside the actionlistener but still have accessability to click while its looping. I don't know much about it, but I think you're going to need a thread. Try something like this... (it doesn't work yet, but I have to take off)
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    class buttonxdemo extends JFrame implements ActionListener{
      Buttonx mybutton;
      //set it all up, make it look pretty  =]
      public buttonxdemo()
           mybutton = new Buttonx("default");
           getContentPane().add(mybutton.thebutton);
           mybutton.thebutton.addActionListener(this);
           this.setDefaultCloseOperation(3);
           this.setSize(200,200);
      public void actionPerformed(ActionEvent ae){
        if (ae.getSource() == mybutton.thebutton)
             if (mybutton.keepGoing)
               mybutton.keepGoing = false;
                else if (!mybutton.keepGoing)
                     mybutton.keepGoing = true;     
          mybutton = new Buttonx(/*Icon,*/"My Button");
          //getContentPane().remove(mybutton);
          //getContentPane().add(mybutton.thebutton);
          mybutton.startstop();
      }//actionperformed
      static void main(String args[])
           new buttonxdemo().show();
    } //movingicondemo
    class Buttonx extends Thread{
      public boolean keepGoing;
      //public Icon ICx;            //perhaps an array, so you can loop through?
      public String strbuttonx;
      public JButton thebutton;     //may have to extend JFrame?
      public Buttonx(/*Icon IC,*/ String strbutton){
        //ICx = IC;
        strbuttonx = strbutton;
        thebutton = new JButton(strbuttonx);
      public void startstop()
        int i = 0;
        while (keepGoing)
          thebutton.setLabel(strbuttonx.substring(0,i));
          //if an array of Icons ICx
          //thebutton.setIcon(ICx);
    i++;
    if (i > strbuttonx.length() - 1)
    i = 0;
    try
         Thread.sleep(1000);
    catch (InterruptedException ie)
         System.out.println("sleep caught: " + ie);
    }//startstop()
    }//buttonx
    kev

  • MDM iView resultset problem and question about eventing

    Hi experts,
    I created a MDM iView resultset for my main table as search table (comparison is not supported). When I click on preview I get an empty table ("Found <Tablename>: 0 of 10", table contains 10 entries at the moment). I tried the same with a subtable and everything works fine (all entries have been in the preview table). Any ideas why I don't get a result?
    My 2nd question: can I choose the parameter name in eventing (EPCF) on my own? So if I have Vendor_Id as field can I use vendorid as parameter name? Do I have to define anything in the listener iView (e.g. in detail iView for an event from resultset iView)? Maybe you have a useful tutorial link (please not SAP help section)?
    Thanks for your answers.
    Regards, bd

    It is possible to retrieve the number of rows from a resultset --
    Statement stmt= con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                        ResultSet.CONCUR_READONLY);
    ResultSet rs= stmt.executeQuery("<your select query here>");
    int totalRows;
    if (rs.last()) // can it move to the last row?
       totalRows= rs.getRow(); // get its row number
    else
       totalRows= 0; // no rows in the resultset
    rs.first() // set the cursor back to the startNote that the resultset has to be scrollable (TYPE_SCROLL_INSENSITIVE).
    kind regards,
    Jos

  • Question about Events stored on an external drive

    Hello guys! I recently freed up a TON of space on my iMac by adding an external hard drive and you guys advised me on how to get iMovie '08 to store my Events there.
    Question: I'm going to Rome Italy tomorrow and I'm going to be doing a ton of video footage. My Macbook doesn't have the hard drive space to hold what I'm going to be shooting.
    So, my question is......considering that I'm using this external drive to store Events from my iMac will I be able to to use that same external drive on this trip to manage Events on my MacBook?
    In other words, I just want to make sure that I don't confuse either version of iMovie that I have operating on these two different machines. Can I use this same external hard drive to manage Events from both machines?
    Thanks in advance for the speedy assistance. I'm leaving tomorrow and need to get this issue nailed down.
    Thanks!
    Tony

    I actually have no set-up to test my speculations but...:
    when you tell iM08 to store Events on some ext. drive, it creates on 'Top Level' of that drive the 'iMovie Events' folder..
    so, when you do that with a second Mac/iMovie... I guess, it will confuse the file management.. (=you can not create two indentically named folders... ) ... and, I guess, you can not create/select a sub-folder for the Events...
    best practise would be to partition the drive.. but that isn't possible without erasing any content on your drive..
    Plan B) invest 100$ for a 2nd drive.. ? (last week offer: 79€ for 500 gigs.. no bad... )

  • Question about touch handling

    Hi,
    I have a view that is handling touches. I have a tabbar in the same view. I can determine when touch is made in the area where there is a tabbar .
    The problem is that I want the events inside the tabbar area to be handled by tabbar did select method but could not find a way to do this . If touch handling is on event inside the tabbar has no effect.
    Please help

    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at AccountMgrGui$ButtonHandler.actionPerformed(AccountMgrGui.java:129)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:14
    50)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1504)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:378)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:216)
    at java.awt.Component.processMouseEvent(Component.java:3715)
    at java.awt.Component.processEvent(Component.java:3544)
    at java.awt.Container.processEvent(Container.java:1164)
    at java.awt.Component.dispatchEventImpl(Component.java:2593)
    at java.awt.Container.dispatchEventImpl(Container.java:1213)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
    at java.awt.Container.dispatchEventImpl(Container.java:1200)
    at java.awt.Window.dispatchEventImpl(Window.java:914)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    Press any key to continue . . .

Maybe you are looking for

  • AMSCheck command doesn't seem to go through

    With Adobe Media Server 5, we'd like to use the command "AMSCheck" to check the server status, etc., but this command doesn't seem to go through. We tried searching for it using the "find" command, but there was no result. [root@hostname /]# AMSCheck

  • Data Services / SAP / ABAP

    Hi, i would like to use a var for filter, in an ABAP component my var is a string, that i use for filter like this : KNUMV IN ($MYVAR) with myvar = '0001820242','0001820248','0001820250','0001820253','0001820254','0001820257','0001820258','0001820260

  • New Essbase install - fail at "Register with Shared services

    Hi all, I'm configuring up a new LINUX ( Redhat ) server to run Essbase 11.1 and the installation fails at the point where, in the configtool (using this in GUI mode not command line ) it's registering the components with Shared Services. In the conf

  • Next to spotlight

    There is an icon next to spotlight, on the top right of my screen that I do not want up there. I have tried apple + click to drag it off, but it simply clicks the icon. This icon is run by an application Net Barrier the kicker is that I deleted that

  • I already have a PS CC subscription and I'd like to include Lightroom CC in my plan. But how?

    I already have a PS CC subscription and I'd like to include Lightroom CC in my plan. But how?