Difference in event handling between Java and Java API

could anyone list the differences between Java and java-API in event handling??
thanks,
cheers,
Hiru

the event handling mechanisms in java language
features and API (java Application Programming
Features)features .no library can work without a
language and no language has event handling built in.
I am trying to compare and contrast the event
handling mechanisms in the language and library
combinations such as java/ java API.
all contributions are welcome!
thanks
cheersSorry, I'm still not getting it. I know what Java is, and I know what I think of when I hear API. (Application Programming Interface.) The API is the aggregation of all the classes and methods you can call in Java. If we agree on that, then the event handling mechanisms in Java and its API are one and the same.
So what do you want to know?
%

Similar Messages

  • Event Handling with Java API.: Adding to a hierarchy table throws 2events

    I´m having some problems with the event handling. I´ve registered a Class with extends AbstractDataListener as EventListener. When there are changes in the product hierarchy table, some extra work should be done. However if i add a new record into the hierarchy, two events are fired.
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;Getra?nke, SEW
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;32 Zoll, B&R
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;56 Zoll, Lenze
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;20 Zoll, allgemein
    In this case, i added the records "32 Zoll, B&R" and then "20 Zoll, allgemein". As you can see in both cases two events are fired and the first event seems to come with wrong data. The reported id for the newly created record is R17. For the logging, i did lookup the entry in the hierarchy table by id and use the displayvalue of the record. But the first event always shows the displayvalue from some already existing entry.
    How can i avoid duplicate events or if this is not possible, how i can recognize that the display value of the first event is not valid.

    I have not tetsted it yet, because I'm waiting for my server to be updated, but SAP told me that the API version 5.5.42.67 should fix the problem.
    Thanks for your post.

  • Difference in the Balance between FS10N and Customer Balances in Local Curr

    Hi,
    When i am trying to match the Balances between FS10N and Customer Balances in Local Currency for the Period 8, we are getting the difference, The reconcilliaton Account was changed on 30.08.2010.
    Please help Us in tracing the differences between FS10N and Customer Balances in Local Currency.
    What could be the possible reasons for the differences..
    Thanks

    Hi Varshani,
    Please use the program/report SAPF070 to compare or reconcile your AR with GL balances. You can use SAPF071 to correct any inconsistencies. Provided below documentation for these programs.
    SAPF070  - Compare Documents and Account Transaction Figures
    Description
    This program compares debit and credit transaction figures in customer, vendor, and G/L accounts with the debit and credit totals from documents posted in the corresponding posting period (accounting reconciliation). The sales totals are also compared for customer and vendor accounts. There is no separate comparison for special G/L transactions.
    A comparison for G/L accounts can be made in company code currency and in parallel currencies (such as group currency). A comparison for customer and vendor accounts can only be made in company code currency.
    After the program has finished, a message is issued to the user that started the program. This message summarizes the results of the reconciliation.
    Output
    The program compares the totals of an account on a periodic basis. If the debit and credit total differs between account and documents, the account is printed with the debit and credit totals and the difference.
    Differences in G/L accounts are shown per transaction currency. The first line shows the amount in local currency, the second line shows the amounts in transaction currency.
    If a document which falls within the selection range is posted during the program run, the program is terminated since a reliable result can no longer be delivered.
    SAPF071 - Adjust Balances after Comparing Documents/Transaction Figures
    Description
    If a financial accounting comparative analysis (SAPF190) or a comparison of documents and transaction figures (SAPF070) shows that there are differences between documents and transaction figures, you can use this program to make an adjustment. The documents form the basis for this adjustment. The program adjusts the (redundant) transaction figures, which are only totals of amounts from documents.
    Requirements
    All of the following listed requirements must be fulfilled:
    1. A financial accounting comparative analysis (SAPF190) or a comparison of documents and transaction figures (SAPF070) must be made, and differences must be found between documents and transaction figures.
    2. There must not be any inconsistent documents found. These are listed in both SAPF070 and SAPF190 as well as in this program.
    3. There cannot be any problems in the other modules. Caution: You have to check this yourself. Financial Accounting may be correct but the other modules may not be, and this will adversely affect the program run.
    4. You can only make the adjustment in the ledgers which are compared by program SAPF070. This is ledger 00 or a user-defined ledger for all parallel local currencies except the group currency. (The program displays these ledgers). You have to adjust any additional ledgers as well as average balance ledgers yourself.
    5. No documents during the period in which you are adjusting transaction figures can be archived. Caution: You must ensure that these documents are not archived by establishing appropriate organizational rules and procedures.
    Only use this program after consulting with SAP or after checking the prerequisites thoroughly.
    You should adjust all differences together for a single company code. By setting the program parameters you can limit the adjustment to G/L currency types or to balances in subledgers.
    It is advisable to execute a test run first, which will list any differences that are found.
    Further notes - Authorizations
    Repair program authorization group (F_005)
    Company code authorization         (F_BKPF_BUK)
    Thanks
    Venkata Ganesh Perumalla
    Edited by: Venkata Ganesh Perumalla on Sep 28, 2010 1:30 PM

  • Synchronous message handling between OSB and MQ

    Hi,
    I have a requirement to have a PS in OSB that gets some XML data from another application.
    The PS implementation has to be synchronous.
    The interface is like
    External Application<->OSB PS<->MQ<->OSB <-> External Application
    Can anyone help me with the request-reply implementation(i.e. synchronous call handling) between OSB and MQ.
    Required functionality :
    OSB will get XML data from the external application,will do the data transformation to make it compatible with MQ interface and will then send data to MQ and will wait for the reply from MQ that it then sends back to the external application after transformation.
    Queries:
    How to correlate two messages i.e. request msg to mq and reply msg from mq in OSB?
    What kind of Proxy Service implementation is required to have such functionality?
    If someone can help me with similar kind of implementation,it will be of great help to me.
    Thanks in advance

    OSB support this pattern out of the box . You can implement the MessageID pattern as specified in this link:
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/interopjms/MsgIDPatternforJMS.html
    When you configure the business service to use MessageID as the correlation pattern, the following happens under the hood:
    1. Business service sends request to the MQ request queue. The MQ JMS provider sets the message ID on the message and this is returned to the bs. The business service also sets the reply queue details in the JMSReplyTo Header in the request.
    2. The business service then waits for a response message which has a correlationID equal to the messageID in the request message.
    3. The system which processes the request from the MQ should set the correlation ID of the response to the same value as the Message ID in the request.
    4. The business service process the reply if it is received before the timeout interval. No need to purge the queues for message arriving out after timeout since OSB does this automatically for you.
    A point to note here is that if you deploy this in a cluster , you need to create 'N' local MQ queues for reply, where N is same as the number of managed servers in the cluster. Else you could lose replies in a scenario where the reply for a request sent by man server 'X" is processed by man server "Y". The request-response correlation tables are maintained internally on man server memory. Since Y had no clue of the requests sent in X it would just discard the reply received.
    So create dedicate queues for each man server and specify them in the business service definition.
    Another key thing for this to work would be to get right the MQ setup between the queue manager in OSB domain and the remote system which process the MQ requests. A simple setup would be for you to create all reply queues as local queues under your OSB queue manager and create only a transmission queue with the same name as your OSB queue manager in the remote system. You need to ask the remote system to do the MQOpen with the ReplyToQueue and ReplyToQM names for queue and queue manager names. This will put the replies to the transmission queue to your QM and through it can reach the right reply queue.
    Edited by: atheek1 on Mar 29, 2010 7:50 AM

  • Picture file handling between Aperture and Photoshop

    Hello
    I have transferred several photos via "edit in external editor" from aperture to photoshop.
    In photoshop I made different operations:
    a) just looking (no special manipulations) -> no saving
    b) manipulations on a particular photo -> saving via "save" in PS
    c) combination of different photos -> saving via "save as" in PS
    Meanwhile I have learned, that option C just saves the file in the file system, but does not update the database entry in aperture. I have also found different versions of photos in the file system, which I had just opened in PS (case a). "File system" means in that case, that they are under the folder "masters", when I drill down the Aperture Data File. Case b seems to work OK.
    I have now different questions:
    why are photos, which I have just opened in PS, still in the file system (even when I have deleted them) in Aperture? Seems that those versions are kept. Is'nt that blowing up my database? (case a)
    when I reimport pictures from case c, are they stored a second time in aperture or does the aperture database point to the particular file (because the file already is under the folder "masters")
    Any feedback to data handling between PS and Aperture?
    Thanks in advance,
    Vanillia

    IMO today you are very likely to be best served by the inexpensive Photoshop Elements. However, Adobe's world is changing at the end of this month (March 27) with official announcement of MacIntel versions. You may want to re-ask this question then, being careful of April Fool's Day wags.
    http://www.macworld.co.uk/news/index.cfm?RSS&newsID=17399
    Also, version 2 of Aperture is expected in the next few months, and I will be surprised if simple color tools such as you describe are not included.
    -Allen Wicks

  • Having an issue with event handling - sql & java

    HI all am trying to construct this hybrid of java and mysql. the data comes from a mysql database and I want it to display in the gui. this I have achieved thus far. However I have buttons that sort by surname, first name, ID tag etc....I need event handlers for these buttons but am quite unsure as to how to do it. any help would be much appreciated. Thanks in advance.
    /* Student Contact Database GUI
    * Phillip Wells
    import java.awt.BorderLayout;     
    // imports java class. All import class statements tell the compiler to use a class that is defined in the Java API.
    // Borderlayout is a layout manager that assists GUI layout.
    import javax.swing.*;               // imports java class. Swing enables the use of a GUI.
    import javax.swing.JOptionPane;     // imports java class. JOptionPane displays messages in a dialog box as opposed to a console window.
    import javax.swing.JPanel;          // imports java class. A component of a GUI.
    import javax.swing.JFrame;          // imports java class. A component of a GUI.
    import javax.swing.JButton;          // imports java class. A component of a GUI.
    import javax.swing.JScrollPane;     // imports java class. A component of a GUI.
    import javax.swing.JTable;          // imports java class. A component of a GUI.
    import java.awt.*;               // imports java class. Similar to Swing but with different components and functions.
    import java.awt.event.*;          // imports java class. Deals with events.
    import java.awt.event.ActionEvent;     // imports java class. Deals with events.
    import java.awt.event.ActionListener;     // imports java class. Deals with events.
    import java.sql.*;               // imports java class. Provides API for accessing and processing data stored in a data source.
    import java.util.*;               // imports java class. Contains miscellaneous utility classes such as strings.
    public class studentContact extends JFrame {     // public class declaration. The �public� statement enables class availability to other java elements. 
        private JPanel jContentPane;    // initialises content pane
        private JButton snam, id, fname, exit;     // initialises Jbuttons
        String firstname = "firstname"; //initialises String firstname
         String secondname = "secondname"; //initialises String
        public studentContact() {
            Vector columnNames = new Vector();      // creates new vector object. Vectors are arrays that are expandable.
            Vector data = new Vector();
            initialize();
            try {
                // Connect to the Database
                String driver = "com.mysql.jdbc.Driver"; // connect to JDBC driver
                String url = "jdbc:mysql://localhost/Studentprofiles"; //location of Database
                String userid = "root"; //user logon information for MySQL server
                String password = "";     //logon password for above
                Class.forName(driver); //reference to JDBC connector
                Connection connection = DriverManager.getConnection(url, userid,
                        password);     // initiates connection
                // Read data from a table
                String sql = "Select * from studentprofile order by "+ firstname;
                //SQL query sent to database, orders results by firstname.
                Statement stmt = connection.createStatement
                (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
                //statement to create connection.
                //Scroll sensitive allows movement forth and back through results.
                //Concur updatable allows updating of database.
                ResultSet rs = stmt.executeQuery(sql); // executes SQL query stated above and sets the results in a table
                ResultSetMetaData md = rs.getMetaData();     // used to get the properties of the columns in a ResultSet object.
                int columns = md.getColumnCount(); //
                for (int i = 1; i <= columns; i++) {
                    columnNames.addElement(md.getColumnName(i));     // Get column names
                while (rs.next()) {
                    Vector row = new Vector(columns);          // vectors data from table
                    for (int i = 1; i <= columns; i++) {     
                        row.addElement(rs.getObject(i));     // Get row data
                    data.addElement(row);     // adds row data
                rs.close();     
                stmt.close();
            } catch (Exception e) {     // catches exceptions
                System.out.println(e);     // prints exception message
            JTable table = new JTable(data, columnNames) {     //constructs JTable
                public Class getColumnClass(int column) {     
                    for (int row = 0; row < getRowCount(); row++) {
                        Object o = getValueAt(row, column);
                        if (o != null) {
                            return o.getClass();
                    return Object.class;
            JScrollPane scrollPane = new JScrollPane( table );          // constructs scrollpane 'table'
            getContentPane().add(new JScrollPane(table), BorderLayout.SOUTH);   //adds table to a scrollpane
        private void initialize() {
            this.setContentPane(getJContentPane());
            this.setTitle("Student Contact Database");     // sets title of table
            ButtonListener b1 = new ButtonListener();     // constructs button listener
            snam = new JButton ("Sort by surname");      // constructs Jbutton
            snam.addActionListener(b1);     // adds action listener
            jContentPane.add(snam);          //adds button to pane
            id = new JButton ("Sort by ID");      // constructs Jbutton
            id.addActionListener(b1);     // adds action listener
            jContentPane.add(id);          //adds button to pane
            fname = new JButton ("Sort by first name");      // constructs Jbutton
            fname.addActionListener(b1);     // adds action listener
            jContentPane.add(fname);          //adds button to pane
            exit = new JButton ("Exit");     // constructs Jbutton
            exit.addActionListener(b1);     // adds action listener
            jContentPane.add(exit);          //adds button to pane
        private JPanel getJContentPane() {
            if (jContentPane == null) {
                jContentPane = new JPanel();          // constructs new panel
                jContentPane.setLayout(new FlowLayout());     // sets new layout manager
            return jContentPane;     // returns Jcontentpane
        private class ButtonListener implements ActionListener {     // create inner class button listener that uses action listener
            public void actionPerformed (ActionEvent e)
                if (e.getSource () == exit)     // adds listener to button exit.
                   System.exit(0);     // exits the GUI
                if (e.getSource () == snam)
                if (e.getSource () == id)
                if (e.getSource () == fname)
        public static void main(String[] args) {     // declaration of main method
            studentContact frame = new studentContact();     // constructs new frame
            frame.setDefaultCloseOperation(EXIT_ON_CLOSE);     //exits frame on closing
            frame.setSize(600, 300);          // set size of frame
            frame.setVisible(true);     // displays frame
    }p.s. sorry about the untidy comments!

    OK, so you've got this code here:
    private class ButtonListener implements ActionListener {
      public void actionPerformed (ActionEvent e) {
        if (e.getSource () == exit) {
          System.exit(0); // exits the GUI
        if (e.getSource () == snam) {
        if (e.getSource () == id) {
    }Perfect fine way to do this; although I think creating anonymous would be a bit cleaner:
    snam.addActionListener(new actionListener() {
      public void actionPerformed(ActionEvent ae) {
    });But I think that the real question you have is "what do I put for logic when the JButtons are hit?", right?
    I would answer that you want to dynamically build your SQL statement changing your ordering based on the button.
    So you'd have a method that builds the SQL based on what you pass in - so it takes one argument perhaps?
    private static final int NAME = 1;
                             ID = 2;
    /* ... some code ... */
    snam.addActionListener(new actionListener() {
      public void actionPerformed(ActionEvent ae) {
        buildSQL(NAME);
    /* ... some code ... */
    private void buildSQL(int type) {
      if ( type == NAME ) {
    /* ... build SQL by name ... */
      else if ( type == ID ) {
    /* ... build SQL by id ... */
    }That kind of thing.
    Or you might choose to have several build methods with no parameter type; each building the SQL differently, and calling whichever one you need. I did not read your entire pgm, so I don't know how you'd want to organize it. You need to ask more specific questions at that point.
    ~Bill

  • Event Handling between JPanels

    Hi everyone,
    I'm trying a three-fold assignment on java, which relates to graphs and finding strongly connected components.
    In the first part, the user can create his own graph and the program should find all SCC and display them.
    In the second part, the program creates random graphs and then finds all SCC and displays them.
    In the third part, some statistical data is to be displayed.
    So what I have done so far is that I have created a JFrame on which I have added 3 JPanels, each for every part of the assignment.
    Changing between the JPanels is done by a JTabbedPane.
    My problem lies on the second part. I've created a class called RandomGraphPanel, which extends JPanel. Then I've created two sub-JPanels,
    called RandomGraphAreaPanel, where the graph should be displayed and RandomGraphDataPanel, where the user can choose some parameters on which the random graph is based. I don't know how I can paint the graph on the first sub-JPanel, after pressing a button on the second sub-JPanel.
    I will include some code from my classes:
    public class RandomGraphPanel extends JPanel
         private JPanel graphArea;
         private RandomGraphDataPanel data;
         private RandomGraphAreaPanel area;
         public RandomGraphPanel()
              super();
              setLayout(new BorderLayout(5,5));
              data = new RandomGraphDataPanel();
              area = new RandomGraphAreaPanel();
              add(data, BorderLayout.SOUTH);
              add(area, BorderLayout.CENTER);          
         }//RandomGraphPanel constructor
    }//RandomGraphPanel class
    public class RandomGraphDataPanel extends JPanel
         public RandomGraphDataPanel()
              super();
              //part where RandomGraphDataPanel is filled with 2 JSliders and 1 JButton
         }//RandomGraphDataPanel constructor
         private class ButtonHandler implements ActionListener
              public void actionPerformed(ActionEvent event)
                   //code that is executed when the button is pressed               
              }//actionPerformed
         }//ButtonHandler private class
    }//RandomGraphDataPanel classAny help will be appreciated.
    Thanks,
    philimonas

    Probably the best way would be to somehow implement the MVC pattern here. Another way would be to move the button handling code out of the RandomGraphDataPanel class and into the RandomGraphPanel class. You could then pass the ActionListener into the RandomGraphDataPanel object by perhaps a constructor parameter, or by a separate addActionListener method that you have created. Something like so:
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JPanel;
    public class RandomGraphPanel extends JPanel
        private JPanel graphArea;
        private RandomGraphDataPanel data;
        private RandomGraphAreaPanel area;
        public RandomGraphPanel()
            super();
            setLayout(new BorderLayout(5, 5));
            // *** passing ActionListener to the data class via constructor parameter
            data = new RandomGraphDataPanel(new ButtonHandler());
            area = new RandomGraphAreaPanel();
            add(data, BorderLayout.SOUTH);
            add(area, BorderLayout.CENTER);    
        // *** move this code into this class
        private class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent event)
                area.showGraph();  // or whatever is needed to show graph       
    }and
    //import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class RandomGraphDataPanel extends JPanel
        public RandomGraphDataPanel(ActionListener buttonHandler)
            super();
            JButton someButton = new JButton("Show Graph");
            someButton.addActionListener(buttonHandler);
        private class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent event)
                //code that is executed when the button is pressed         
    }

  • Difference in text rendering between PDF and Mars?

    I was doing some testing with Mars and stumbled upon what
    seemed like suboptimal text rendering. Because it was quite subtle
    and I wanted to make sure there was an actual difference, I did a
    little comparison between PDF and Mars rendering.
    See this image. Can
    you see a difference?
    I'm still not sure whether there is an actual difference, but
    I still somehow got the impression that the upper example (PDF) is
    a little more polished then the lower one (Mars). Are different
    rendering paths actually used? Will it remain that way?
    My SVG for Mars was very simple:
    <text font-size="10pt" x="20" y="20" fill="rgb(0,0,0)"
    font-family="F0">aex</text>
    The PDF was produced with MS Office 2007 and Microsofts Save
    as PDF plugin (also at 10pts). The font is Gentium.

    The difference *IS* subtle, but you're right -- there does
    appear to be a perceptible difference between the two samples.
    Without making an in-depth study, it's hard to say whether we
    can do anything about this. Even though they're both opened in
    Acrobat, the rendering path for a Mars document is *VERY* different
    from the path for a PDF document, and many of the events along the
    chain are out of the control of those of us writing the Mars
    plugin. There are some text-quality issues that I'd like to take
    care of in time for our next release, however; perhaps I'll be able
    to address this particular issue at the same time.

  • Event Handler Between Reboot states using Powershell

    Hi,
    I need some help writing an event handler for a powershell script that would meet the following requirement:
    1.  Continue Upon a restart
    2.  Continue Upon a sleep state
    3.  Continue Upon a hibernation state.

    One way that I can see that would meed all three of your requirements is to use a permanent WMI Consumer to watch the event log for each of these type of events and then perform an action.
    http://learn-powershell.net/2013/08/14/powershell-and-events-permanent-wmi-event-subscriptions/
    It would be best to make a filter for each type of event rather than throwing all into one filter. Depending on your OS, the event IDs may be different, but it is nothing that a quick query via a search engine could find for you.
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Differences in sort order between iTunes and iPod

    Can someone explain how the sort order of artists / albums works? It seems that it is different between iTunes and the iPod. In iTunes (7.3.1) I can enter data in the fields for Artist, Album Artist, Sort Artist and Sort Album Artist. When I get the tracks to appear in the order I want in iTunes, it doesn’t seem to transfer across to my iPod. I know there are some differences in how the sort order works in both, but how is it different?
    John.
    Dell 5150   Windows XP  

    ou must have an older iPod.
    I believe the new sort order only works on the new iPods (Nano and Video)

  • Difference in PL/SQL between 8i and 9i

    Hi
    Where can I find the exact differences in PL/SQL alone between 8i and 9i from developers point of view.
    I appreciate your help
    Thanks

    Well, you would find it at the most obvious place - The Oracle documentation, where else?
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/whatsnew.htm#967650

  • Event handling between JComboBox & JCheckBox

    Hi.
    My problem is that when i click on the JCheckBox object, the code (i have) also executes the condition for JComboBox object. I assume there is a very simple solution, but i have yet to find it.
    This is the code i'm using:
         public void itemStateChanged(ItemEvent e){
              if(qcmCheckBox.isSelected()){
                   System.out.println("checkbox selected");
              if(e.getStateChange() == ItemEvent.SELECTED){
                   System.out.println("combo selected " + comboBoxOptions.getSelectedIndex());
         }My problem is, i think, that the e.getStateChange() is always returning true. I just haven't figured out a way to 'single out' when the JComboBox is selected.

    thanks for the tip, but that didn't exactly work.
    these are my steps:
    select second drop down option (out of 3)
    select checkbox
    deselect checkbox
    old output
    combo selected1
    qcm selected
    combo selected1new output (using instanceof)
    combo selected 1
    combo selected 1
    checkbox selected
    combo selected 1
    combo selected 1here's my code:
    // setting up vars
    private JCheckBox checkBox = new JCheckBox();
    private final String comboNames[] = {"Option 1", "Option 2", "Option 3"};
    private JComboBox comboBoxOptions = new JComboBox(comboNames);
    // combo box
    comboBoxOptions.addItemListener(this);
    // checkbox
    checkBox.addItemListener(this);
    // event handler
    public void itemStateChanged(ItemEvent e){
         if(checkBox.isSelected()){
              System.out.println("checkbox selected");
         //if(comboBoxOptions instanceof JComboBox){ // the suggested alternative
         if(e.getStateChange() == ItemEvent.SELECTED){
              System.out.println("combo selected " + comboBoxOptions.getSelectedIndex());
    }For some reason, the suggested answer gives me duplicate entries for the dropdown and it still gives me duplicate entries when i click on the checkbox.
    Again, what i'm trying to do is just get the checkbox not to execute the 2nd if statement "if(e.getStateChange() == ItemEvent.SELECTED){"
    I think the statement "e.getStateChange()" is returning everything true because its an event happening but i don't know a way to single the checkbox event.
    I would appreciate all the help I can get. Thanks.
    sijis

  • Help, about data synchronization between C++ and PHP API!

    I use Berkeley DB XML as my Server's database, the client access the database via http by C++ API. I don't close the XmlManager and XmlContainer after read and write the database for better performance. However, I provide another way to manipulate the database via web by PHP. After I updated the data by PHP, I found that I couldn't catch the update.
    If I close the XmlManager and XmlContainer after read and write the database every time, the problem disappeared. But I can't do that for performance.
    How can I solve this problem? Thanks!

    First of all, thank you for your attention.
    I don't share the same environment for the two processes, but I seted the same configure flags on the environment. The flags as follows:
    DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER;
    The C++ code as follows:
    //C++ code
    UINT32 envFlags = DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER;
    INT32 lRet = 0;
    string ctnName = "rls_services.bdbxml";
    string docName = "index.xml";
    CHAR acXQuery[256] = {0};
    CHAR acXmlDoc[] = "<test>C++ test</test>";
    //from      
    DbEnv *pDbEnv  = new DbEnv(0);
    XmlManager *pxmlMgr = NULL;
    pDbEnv->open("/usr/local/xdms", envFlags, 0);
    pxmlMgr = new XmlManager(pDbEnv, DBXML_ADOPT_DBENV);
    lRet = pxmlMgr->existsContainer(ctnName);
    if(0 == lRet)
         pxmlMgr->createContainer(ctnName);     
    XmlContainer xmlCtn = pxmlMgr->openContainer(ctnName);
    //to
    // the code between 'from' and 'to' is a seperate function
    XmlQueryContext xmlQC = pxmlMgr->createQueryContext();
    XmlUpdateContext xmlUC = pxmlMgr->createUpdateContext();
    sprintf(acXQuery, "doc(\"%s/%s\")", ctnName, docName);
    XmlQueryExpression xmlQE = pxmlMgr->prepare(acXQuery, xmlQC);
    XmlResults xmlResult = xmlQE.execute(xmlQC);
    XmlDocument xmlDoc;
    if (xmlResult.hasNext())
    xmlDoc = xmlCtn.getDocument(docName);
    xmlDoc.setContent(acXmlDoc);
    xmlCtn.updateDocument(xmlDoc, xmlUC);
    else
    xmlDoc = pxmlMgr->createDocument();
    xmlDoc.setName(docName);
    xmlDoc.setContent(acXmlDoc);
    xmlCtn.putDocument(xmlDoc, xmlUC);
    // I don't close the Container and Manager for performance
    The PHP code as follow:
    <php?
    $DB_DIR = "/usr/local/xdms";
    $env = new Db4Env();
    $enFlags = DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER;
    $env->open("/usr/local/xdms", $enFlags, 0);
    $xmlManager = new XmlManager($env, 0);
    $ctnName = 'rls_services.bdbxml';
    $docName = 'index.xml';
    $docContent = '<test>PHP test</test>';
    if (!$xmlManager->existsContainer($ctnName))
         return ;
    $xmlCtn = $xmlManager->openContainer($ctnName);
    $xmlQC = $xmlManager->createQueryContext();
    $xmlUC = $xmlManager->createUpdateContext();
    $acXQuery = "doc('".$ctnName.'/'.$docName."')";
    $xmlQE = $xmlManager->prepare($acXQuery, $xmlQC);
    $xmlResult = $xmlQE->execute($xmlQC);
    if ($xmlResult->hasNext())
         $xmlDoc = $xmlCtn->getDocument($docName);
         $xmlDoc->setContent($docContent);
         $xmlCtn->updateDocument($xmlDoc, $xmlUC);
    else
         $xmlDoc = $xmlManager->createDocument();
         $xmlDoc->setName($docName);
         $xmlDoc->setContent($docContent);
         $xmlCtn->putDocument($xmlDoc, $xmlUC);
    unset($xmlDoc);
    unset($xmlCtn);
    ?>
    The code between 'from' and 'to' excute only one time when server start.
    After the server started, I write data by PHP. I can read out the data that
    writed by PHP just now, but I can't read out the data by C++ because I don't
    close the XmlContainer and XmlManager.
    After I restarted the server, I can readout the data by C++. But I can't
    open and close database for each request for performance as a server.
    what should I do ? Thank you!
    Whether I express my question clearly or not?

  • Event handling in java

    Can we write a generic event listener which is activated on any event ?
    for example: instead of activating an event listener on clicking a butoon in should be activated on any mouse click...

    "Java" is too generic. I assume you mean Swing; you might as well be talking about JavaFX here. Your requirement is a bit odd and very much conflicting in any case. There is no such thing as a generic event listener, there are specific listeners for specific events.
    In stead of asking how to technically implement something, why don't you explain what you want to functionally achieve?

  • Difference of JDK version between sharing and non-sharing

    Hi,
    Here, I got two version of JDK 1.6 as below:
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode)
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
    What's the difference between them? Where can I download the non-sharing one?(actually, the non-sharing version now I got, is somebody gave me, he can't remember where he got it)
    I know the sharing version can speed up the loading process, but the problem I met has nothing concerning about this.
    My application is to read data from some xml files, and to import them into database. But the performance of using these two version of JDK is so different. Using the non-sharing version could be pretty much 10 times faster than the sharing one. Even if I turn off the switch of sharing by using -Xshare:off, I still couldn't get help.
    Someone cool guy can help me here? Thanks!

    I don't personally have much experience relinking across platforms. (We use Windows servers although I use Mac locally.) But, here's what info I can provide:
    File paths in InDesign can be specified in 2 ways. One is platform-specific paths, and the second is URI notation. The URI notation is the same cross-platform, but even so, I imagine the volume names are different as well. Specifying the URIs in an InDesign file would prove to be challenging as well, although you can easily specify it in an IDML file.
    Another avenue to explore would be to specify relative paths. By default InDesign writes absolute paths, but relative paths are supported. If I'm not mistaken, that's what the InDesign package functionality does.
    Your best bet will probably be to run a script when the document loads on the machine for the first time and loop through all the links and change the paths to the correct location.
    HTH,
    Harbs

Maybe you are looking for

  • Ipad 2 up button is stuck

    My ipad 2 up button is stuck can i send back to apple store warranty?? And How Can I Check My ipad Is not Underwarranty ?? Thank you~

  • Please pause this slide.

    I have a program in Captivate 5.  On one of the slides, I have an image of a man with a "thought cloud" behind and above his head.  I have added text boxes to this thought cloud making the captions appear within 2 seconds of each other.  I have the t

  • Problem validating an two Input Date components !...

    Hi to all the users !. I would like to tell my problem... I have two input dates ("from" and "to") and I would like that the value from the "from" component isn't higher than the value from the "to" component... For that, I have use a validateDateTim

  • I could not open .osx file on my snow leopard

    i could not open .osx file on my macbook air 10.6.8 snow leopard. what should i do.

  • Problems with iCAL,iPHOTO and Windows XP (using parrallells) after Leopard

    I installed Leopard and now iCAL won't publish to the web. When you try to access it from the web it says the page can't be located... that the calendar may have been deleted or renamed. No body at Mac can figure it out so far. I also can no longer o