Need to listen for tab KeyEvents

i have implemented a JTree, and added a key listener to it. i want to listen for when the user presses the tab key, but for some reason the tab key does not cause the keyPressed or keyReleased methods to be called (all other keys do). I guess it is something to do with the tree loosing focus (the tab key generally moves focus to the next component). does anyone know how to solve this problem?

here is my code:
// this is the class that contains the JTree
public class XMLTreeViewer extends JPanel
     protected JTree tree;
     protected JScrollPane treeScrollPane;
     public XMLTreeViewer(String xmlFile)
          tree = new JTree(root);
          treeScrollPane = new JScrollPane(tree);
          setLayout(new BorderLayout());
          add(treeScrollPane, BorderLayout.CENTER);
     public JTree getTree()
          return tree;
// this is the class that adds the keyListener to the JTree
public class AnatomyLinkingTool extends JPanel
     protected XMLTreeViewer anatomyTree;
     public AnatomyLinkingTool()
          anatomyTree = new XMLTreeViewer("../XML/Anatomy2.xml");     
          anatomyTree.getTree().addKeyListener(new TabListener());
     // inner class
     protected class TabListener extends KeyAdapter
          public void keyPressed(KeyEvent e)
               System.out.println("In keyPressed()");
               if (keyCode == KeyEvent.VK_TAB)
                    System.out.println("tab pressed : ) ");
}keyPressed( ) gets called when i press any key except the tab key! thanks in advance for any help you can offer.

Similar Messages

  • Listening for UncaughtErrorEvents from SubApp loaded by SWFLoader

    I can't seem to get my uncaughtErrorEvents listener to fire when attached to the loader.uncaughtErrorEvents  or loaded content's loaderInfo.uncaughtErrorEvents when loading a swf via SWFLoader.
    I have a main Flex Application ('A.swf') loading a SubApplication  (defined in' B.swf') via a SWFLoader and I need to listen for  UncaughtErrorEvent from the SubApplication. I'm not able to get my event  listeners to be called when I throw an error from within the SubApp  ('B.swf').
    After reading the asDoc for UncaughtErrorEvent and  UncaughtErrorEvents It states that the UncaughtErrorEvent should go through the normal capture, target, and bubble phases through the loaderInfo hierarchy. This doesn't seem to be the case or I'm not understanding the documentation/usage.
    I have added an event listener to A.swf's loaderInfo  (The 'outter' main app) and also to B.swf's loaderInfo (though the Docs  say not to do it here it is part of the event sequence in the capture  and bubble phase...) as well as the SWFLoader internal  FlexLoader.uncaughtErrorEvent (per Docs) like so:
    SWFLoader's internal FlexLoader uncaughtErrorEvents
    swfLoader.content.loaderInfo.loader.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorFunction );
    and the loaded SWF's loaderInfo:
    swfLoader.content.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorFunction );
    When I throw an Error from the SubApplication (B.swf). Only the 'outter' main app's (A.swf) event listener gets called. Which you expect, at first, if it is in the capture phase, but it isn't in that eventPhase at all. When debugging the eventPhase is in the EventPhase.AT_TARGET phase while being handled by A.swf's LoaderInfo, howeever the ASDoc says the Target phase should be B.swf's LoaderInfo.
    Is this a bug between Flash player and Flex where the event isn't flowing correctly as stated in the ASDoc for UncaughtErrorEvent?

    Thanks for the reply Alex.
    The Outer main swf and the SubApp swf are in different ApplicationDomains (sibilings to each other) so they should not be sharing the class that is throwing the error. I should note that these two Applications are purely based on MX components, this is important later on.
    I was originally throwing the error from a Button click handler from B.swf:
    <mx:Button label="Throw Error" click="callLater( throwUncaughtError )" />
    I was wrapping the handler function in a callLater because without it the error is not caught at all and the default flash dialog console just appears with the error. The A.swf's loaderInfo.uncaughtErrorEvents handler was not even firing unless I wrapped it a callLater.
    I realized that Flash Builder's default to link the 4.1 SDK library via Runtime shared libraries was what was causing the A.swf's loaderInfo.uncaughtErrorEvent to fire in the AT_TARGET phase when using callLater. This is because the UIComponent's callLater method queue structure is shared between the two SWFs and therefore inside a function executing off the method queue A.swf's loaderInfo IS the TARGET... explainable, but at first thought that isn't how I'd expect this to work.
    I then decided to test this out by setting the SDK library to merge into the code for both A.swf and B.swf and removing the  callLater. IT WORKS!  B.swf's (the SubApp) loaderInfo.uncaughtErrorEvents handler fires and I prevent the default (flash error console from appearing) and can stopImmediatePropagation so A.swf's loaderInfo.uncaughtErrorEvents handler doesn't fire.
    Perfect besides having to merge the SDK libraries into each swf independently.... size killer.
    In summary, using the same exact code for A.swf and B.swf:
    1. When the SDK libraries are RSL - no UncaughtErrorEvents, neither A.swf's or B.swf's, is called. Instead the default flash error console appears with no chance to handle the uncaught error.
    2. When the SDK libraries are Merged into the code - both A.swf's and B.swf's uncaughtErrorEvents  will be called, according to the asDoc documented sequence; B.swf's uncaughtErrorEvents in the AT_TARGET phase and A.swf's uncaughtErrorEvents in the BUBBLE phase.
    Moreover, if I build a pure Spark implementation everything works even when referencing the SDK libraries as RSL.
    Does this indicate a bug in the globalplayer (flash player code)'s logic for handling UncaughtErrorEvents listeners within the loaderInfo hierarchy when the Flex SDK is Shared code between the SWFs?
    OR
    Since it works in Spark, is it an issue with how the flex2.compiler.mxml.Compiler turns MX based mxml components into generated AS classes (it hooks up the inline event listeners of child UIComponentDescriptor using a generic object and the click function is specified as a STRING and has to use untyped bracket notation to lookup on the UICompoent when adding it as a listener:
    new mx.core.UIComponentDescriptor({
                  type: mx.controls.Button
                  events: {
                    click: "___B_Button1_click"
                  propertiesFactory: function():Object { return {
                    label: "Throw Error"
    Where as Spark does this correctly and generates Factory functions for setting up child UIComponents when converting Spark component mxml to AS:
    private function _B_Button1_c() : spark.components.Button
        var temp : spark.components.Button = new spark.components.Button();
        temp.label = "Throw Error";
       temp.addEventListener("click", ___B_Button1_click);
        if (!temp.document) temp.document = this;
        mx.binding.BindingManager.executeBindings(this, "temp", temp);
        return temp;
    * @private
    public function ___B_Button1_click(event:flash.events.MouseEvent):void
        throwUncaughtError()
    Sadly, moving to pure Spark would be a big hit is my project's schedule and at this point and likely isn't feasible. I have examples (with view source) built in MX for both the RSL and MERGE cases, I just don't know how to attach them here.
    Sorry for the long comments and thanks again!

  • The new iTunes update gives me no option for a "share" tab on the side bar for me to play home shared music. why? please help i need to listen to beyonce!! plzzz

    The new iTunes update gives me no option for a "share" tab on the side bar for me to play home shared music. why? please help i need to listen to beyonce!! plzzz

    "share tab on the side bar ..."
    iTunes has not had a sidebar for over a year.  You can see one (as iTunes 10 used to show) by doing View > Show Sidebar from iTunes' menu.
    But I'm not sure if that is your issue.  You do not need a sidebar to do home sharing.  Are you running the current iTunes (11.1.3)?  Have you turned on sharing in Preferences?   Have you done File > Turn on Home Sharing?

  • [svn:fx-trunk] 12481: Because of the Change/Changing changes in VideoPlayer , we need to also listen for a CHANGE as well as the CHANGE_END, CHANGE_START, THUMB_PRESS, and THUMB_RELEASE events.

    Revision: 12481
    Revision: 12481
    Author:   [email protected]
    Date:     2009-12-03 18:48:17 -0800 (Thu, 03 Dec 2009)
    Log Message:
    Because of the Change/Changing changes in VideoPlayer, we need to also listen for a CHANGE as well as the CHANGE_END, CHANGE_START, THUMB_PRESS, and THUMB_RELEASE events.
    Also, when clicking on the track and animating, the scrubbar's playedArea should move along with the thumb.  We do this by using pendingValue, rather than value in updateSkinDisplayList().
    QE notes: -
    Doc notes: -
    Bugs: SDK-24528
    Reviewer: Kevin
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24528
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/mediaClasses/ScrubBar.as

    My first observation is that you don't reraise the error in the CATCH handler. That is bad, because it makes the proceedure fail silently which may be very difficult to troubleshoot.
    The version numbers for Change Tracking are indeed database-global. MIN_VALID_VERSION can be different for different tables, if they have different retention periods. But if they all have the same retention period, it seems likely that MIN_VALID_VERSION
    would increase as the database moves on.
    I'm not sure about your question Can we use the CHANGE_TRACKING_CURRENT_VERSION even though we want to download subset of data from the table (only records matching for one data_source_key at a time). Where would you use it? How would you use
    it?
    Erland Sommarskog, SQL Server MVP, [email protected]

  • I need help figuring out how to creat a button listener for my panel

    import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
       import java.util.Scanner;
        public class ExpressionCalculatorPanel extends JPanel
       // Variables to be used
          private JLabel inputLabel, resultLabel;
          private JTextField ExpressionCalculator;
          private JButton computeButton;
       //  Constructor: Sets up the main GUI components.
           public ExpressionCalculatorPanel()
             inputLabel = new JLabel ("Enter a value of x");
             resultLabel = new JLabel ("Final result = ---");
             ExpressionCalculator = new JTextField (5);
             ExpressionCalculator.addActionListener(new ButtonListener());
               // Set buttons and listeners
             computeButton = new JButton("Compute Final Result");
             computeButton.addActionListener(new ButtonListener());
               // Add to panels
             add (computeButton);
             add (inputLabel);
             add (resultLabel);
             setPreferredSize (new Dimension(300, 75));
             setBackground (Color.white);
       //  Represents an action listener for the temperature input field.
           private class ButtonListener implements ActionListener
          //  Performs the conversion when the enter key is pressed in
          //  the text field.
              public void actionPerformed (ActionEvent event)
       }

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Scanner;
    public class ExpressionCalculatorPanel extends JPanel
    // Variables to be used
    private JLabel inputLabel, resultLabel;
    private JTextField ExpressionCalculator;
    private JButton computeButton;
    // Constructor: Sets up the main GUI components.
    public ExpressionCalculatorPanel()
    inputLabel = new JLabel ("Enter a value of x");
    resultLabel = new JLabel ("Final result = ---");
    ExpressionCalculator = new JTextField (5);
    ExpressionCalculator.addActionListener(new ButtonListener());
         // Set buttons and listeners
    computeButton = new JButton("Compute Final Result");
    computeButton.addActionListener(new ButtonListener());
         // Add to panels
    add (computeButton);
    add (inputLabel);
    add (resultLabel);
    setPreferredSize (new Dimension(300, 75));
    setBackground (Color.white);
    // Represents an action listener for the temperature input field.
    private class ButtonListener implements ActionListener
    // Performs the conversion when the enter key is pressed in
    // the text field.
    public void actionPerformed (ActionEvent event)
    }

  • Disclosure Listener for PanelTabbed

    Hi All
    <<Jdeveloper 11.1.2.3.>>
    I have a paneltabbed component with 5 tabs (show detail item). My scenario is Every-time user clicks on a tab I need to perform same set of tasks (like refreshing the VO to check for new data).
    Only If the user selects Tab3 then the logic executed is different.
    What is the best of achieving this.
    Do I need to write a disclosure listener for every single tab or I can have a same disclosure listener for 4 tabs which does same action and one other disclosure listener for Tab3.
    Kindly guide me with the correct approach.
    regards,
    bnkr

    Hi,
    Here is the sample code with only one disclosure event for all tabs with condition inside to check which tag is disclosed:
    <af:panelTabbed id="pt1">
    <af:showDetailItem text="Tab 1" id="sdi1"
         disclosureListener="#{<Bean>.tabDisclosed}">
        <af:outputText value="Tab 1 Contents" id="ot1"/>
        <af:clientAttribute name="disclosedTab" value="Tab1"/>        
    </af:showDetailItem>
    <af:showDetailItem text="Tab 2" id="sdi2"
         disclosureListener="#{<Bean>.tabDisclosed}">
        <af:outputText value="Tab 2 Contents" id="ot2"/>
        <af:clientAttribute name="disclosedTab" value="Tab2"/>        
    </af:showDetailItem>              
    <af:showDetailItem text="Tab 3" id="sdi3"
         disclosureListener="#{<Bean>.tabDisclosed}">
        <af:outputText value="Tab 3 Contents" id="ot3"/>
        <af:clientAttribute name="disclosedTab" value="Tab3"/>        
    </af:showDetailItem>
    </af:panelTabbed>
    // Bean Code
        public void tabDisclosed(DisclosureEvent disclosureEvent){
            if (disclosureEvent.isExpanded() == true) {          
                if(disclosureEvent.getComponent().getAttributes().get("disclosedTab").equals("Tab3")){
                    //TODO Code when Tab 3 is disclosed              
                }else{
                    //TODO Code for other tabs
    Note that af:clientAttribute is set for each showDetailItem where we pass the value for disclosedTab attribute to identify which tab is disclosed
    Sireesha

  • Need patch list for my synths

    Hello everyone.
    I need patch info for the following devices to use with Logic pro 8
    ROLAND FANTOM G8
    KORG TRITON PRO
    EMU PROTEUS 2500
    ROLAND JV880
    YAMAHA SY77
    can ANYONE HELP ME PLEASE?
    God Bless

    Thanks Fermusic! I had the same issue as the other person, and followed your instructions. You really know your stuff! (Btw, I listened to "The Game of Life", and it is a great song! Sounds to me to be very radio-worthy song for top-40 radio stations here in the USA.) I've gotten to the point where I have your ISO files in my environment, but they are not controlling my synth correctly. I have a Roland JV-1010 with the SR-JV80-02 Orchestral Expansion card (actually, I have two JV-1010's, and the other has the SR-JV80-16 Orchestral II Expansion card; my aim is to hook the 2nd JV-1010 to the first via the Midi Thru, but I'll worry about that later). Anyway, in the Environment I clicked all 16 boxes for the JV-1010 and all 16 boxes for the SR-JV80-02 Orchestral, as well as all 16 boxes for Session, which is included with the JV-1010. So, now when I create a track in my main arrange window, I can make it an external MIDI track, and access the menu in the Library tab that has all the instruments I imported into my Environment, which is good. When I select the JV-1010 option, it lists all 16 channels that I enabled, and same for the Orchestral and Session options. Once I select one of those, I go under the Inspector, and check the box next to Program, and then select the patch I want from the list of 1 through 127. However, when I do that, the sound I get when I play my MIDI keyboard does not correspond with the listed patch. Furthermore, the JV-1010 by itself (without the expansion card) has about seven sets of 1-127 (there's Preset A, B, C, D, and E). I don't know how to access all these different sets of 1-127. The Inspector only gives me the option to select from one set of 1-127, which I think is Preset-A. How do I access Presets B, C, D, and E? And likewise with the Session and Orchestral options, in actuality there's two sets of 1-127, but it only lists one set. How do I get to the other 127 patches? Also, your ISO list does not include the Orchestral II expansion- is that one available?
    There's another similar, but different problem I'm having. I purchased Finale 2009, which comes with the Garritan Personal Orchestra sound library. I don't know how to access that sound library from within Logic. I Googled it the other day, and someone made mention of the Kontakt Player. Apparently, Finale/Garritan used to ship with the Kontakt Player, but they've replaced it with their own player, called Aria Player, and I can't bring up Aria Player from within Logic. I guess I will try to download a free version of Kontakt Player and maybe Logic will recognize it.
    All these issues have in common the same problem: inter-usability of sound libraries, be they software sounds like Garritan Personal Orchestra or hardware sounds like the JV-1010. This is an extremely vexing and challenging issue! Btw, once I get Logic to recognize all of my sound libraries (software and hardware alike), I'm going to turn my attention to Finale, and try to get all of my Logic sound library as well as the JV-1010 working with it. Any advice there? Haha- sorry to overload you with questions, but you are apparently a well of knowledge!

  • I cannot find all my installed apps on the "use cellular data for" tab on the settings menu.

    I have a new iphone 5s and on the first day I've received it, I updated to IOS 8.0.2.
    Today, I've decided to turn my cellular data on and, in order to consume less data, I thought I would disable some of the apps. However, only a few were available/visible on the "use cellular data for" tab. However, when, with the cellular data turned on, I opened a missing app on the phone, it would start to appear on the list (where it wasn't previously). Also, when I go to the app on the settings menu, it would not have shown the option, "use cellular data" before I've opened the app and now it does. Do I need to turn on every single app before I can select my cellular data preferences? I know people with the same phone and their apps appear all, as expected.
    I don't know if this is a problem of my own carrier but I don't think so, because the people I mentioned earlier have the same carrier.
    Any help would be appreciated.
    Thank you.

    Did you try to reset the phone by holding the sleep and home button for about 10sec, until the Appel logo comes back again? You will not lose data by resetting.
    If this does not work, did you try to switch off Cellular Data, restart the phone and switch it back on again?

  • Huge performance differences between a map listener for a key and filter

    Hi all,
    I wanted to test different kind of map listener available in Coherence 3.3.1 as I would like to use it as an event bus. The result was that I found huge performance differences between them. In my use case, I have data which are time stamped so the full key of the data is the key which identifies its type and the time stamp. Unfortunately, when I had my map listener to the cache, I only know the type id but not the time stamp, thus I cannot add a listener for a key but for a filter which will test the value of the type id. When I launch my test, I got terrible performance results then I tried a listener for a key which gave me much better results but in my case I cannot use it.
    Here are my results with a Dual Core of 2.13 GHz
    1) Map Listener for a Filter
    a) No Index
    Create (data always added, the key is composed by the type id and the time stamp)
    Cache.put
    Test 1: Total 42094 millis, Avg 1052, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 2: Total 43860 millis, Avg 1096, Total Tries 40, Cache Size 80000
    Update (data added then updated, the key is only composed by the type id)
    Cache.put
    Test 3: Total 56390 millis, Avg 1409, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 4: Total 51734 millis, Avg 1293, Total Tries 40, Cache Size 2000
    b) With Index
    Cache.put
    Test 5: Total 39594 millis, Avg 989, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 6: Total 43313 millis, Avg 1082, Total Tries 40, Cache Size 80000
    Update
    Cache.put
    Test 7: Total 55390 millis, Avg 1384, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 8: Total 51328 millis, Avg 1283, Total Tries 40, Cache Size 2000
    2) Map Listener for a Key
    Update
    Cache.put
    Test 9: Total 3937 millis, Avg 98, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 10: Total 1078 millis, Avg 26, Total Tries 40, Cache Size 2000
    Please help me to find what is wrong with my code because for now it is unusable.
    Best Regards,
    Nicolas
    Here is my code
    import java.io.DataInput;
    import java.io.DataOutput;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.Map;
    import com.tangosol.io.ExternalizableLite;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.Filter;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.extractor.ReflectionExtractor;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.MapEventFilter;
    public class TestFilter {
          * To run a specific test, just launch the program with one parameter which
          * is the test index
         public static void main(String[] args) {
              if (args.length != 1) {
                   System.out.println("Usage : java TestFilter 1-10|all");
                   System.exit(1);
              final String arg = args[0];
              if (arg.endsWith("all")) {
                   for (int i = 1; i <= 10; i++) {
                        test(i);
              } else {
                   final int testIndex = Integer.parseInt(args[0]);
                   if (testIndex < 1 || testIndex > 10) {
                        System.out.println("Usage : java TestFilter 1-10|all");
                        System.exit(1);               
                   test(testIndex);               
         @SuppressWarnings("unchecked")
         private static void test(int testIndex) {
              final NamedCache cache = CacheFactory.getCache("test-cache");
              final int totalObjects = 2000;
              final int totalTries = 40;
              if (testIndex >= 5 && testIndex <= 8) {
                   // Add index
                   cache.addIndex(new ReflectionExtractor("getKey"), false, null);               
              // Add listeners
              for (int i = 0; i < totalObjects; i++) {
                   final MapListener listener = new SimpleMapListener();
                   if (testIndex < 9) {
                        // Listen to data with a given filter
                        final Filter filter = new EqualsFilter("getKey", i);
                        cache.addMapListener(listener, new MapEventFilter(filter), false);                    
                   } else {
                        // Listen to data with a given key
                        cache.addMapListener(listener, new TestObjectSimple(i), false);                    
              // Load data
              long time = System.currentTimeMillis();
              for (int iTry = 0; iTry < totalTries; iTry++) {
                   final long currentTime = System.currentTimeMillis();
                   final Map<Object, Object> buffer = new HashMap<Object, Object>(totalObjects);
                   for (int i = 0; i < totalObjects; i++) {               
                        final Object obj;
                        if (testIndex == 1 || testIndex == 2 || testIndex == 5 || testIndex == 6) {
                             // Create data with key with time stamp
                             obj = new TestObjectComplete(i, currentTime);
                        } else {
                             // Create data with key without time stamp
                             obj = new TestObjectSimple(i);
                        if ((testIndex & 1) == 1) {
                             // Load data directly into the cache
                             cache.put(obj, obj);                         
                        } else {
                             // Load data into a buffer first
                             buffer.put(obj, obj);                         
                   if (!buffer.isEmpty()) {
                        cache.putAll(buffer);                    
              time = System.currentTimeMillis() - time;
              System.out.println("Test " + testIndex + ": Total " + time + " millis, Avg " + (time / totalTries) + ", Total Tries " + totalTries + ", Cache Size " + cache.size());
              cache.destroy();
         public static class SimpleMapListener implements MapListener {
              public void entryDeleted(MapEvent evt) {}
              public void entryInserted(MapEvent evt) {}
              public void entryUpdated(MapEvent evt) {}
         public static class TestObjectComplete implements ExternalizableLite {
              private static final long serialVersionUID = -400722070328560360L;
              private int key;
              private long time;
              public TestObjectComplete() {}          
              public TestObjectComplete(int key, long time) {
                   this.key = key;
                   this.time = time;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
                   this.time = in.readLong();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
                   out.writeLong(time);
         public static class TestObjectSimple implements ExternalizableLite {
              private static final long serialVersionUID = 6154040491849669837L;
              private int key;
              public TestObjectSimple() {}          
              public TestObjectSimple(int key) {
                   this.key = key;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
              public int hashCode() {
                   return key;
              public boolean equals(Object o) {
                   return o instanceof TestObjectSimple && key == ((TestObjectSimple) o).key;
    }Here is my coherence config file
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>test-cache</cache-name>
                   <scheme-name>default-distributed</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>          
              <distributed-scheme>
                   <scheme-name>default-distributed</scheme-name>
                   <backing-map-scheme>
                        <class-scheme>
                             <scheme-ref>default-backing-map</scheme-ref>
                        </class-scheme>
                   </backing-map-scheme>
              </distributed-scheme>
              <class-scheme>
                   <scheme-name>default-backing-map</scheme-name>
                   <class-name>com.tangosol.util.SafeHashMap</class-name>
              </class-scheme>
         </caching-schemes>
    </cache-config>Message was edited by:
    user620763

    Hi Robert,
    Indeed, only the Filter.evaluate(Object obj)
    method is invoked, but the object passed to it is a
    MapEvent.<< In fact, I do not need to implement EntryFilter to
    get a MapEvent, I could get the same result (in my
    last message) by writting
    cache.addMapListener(listener, filter,
    true)instead of
    cache.addMapListener(listener, new
    MapEventFilter(filter) filter, true)
    I believe, when the MapEventFilter delegates to your filter it always passes a value object to your filter (old or new), meaning a value will be deserialized.
    If you instead used your own filter, you could avoid deserializing the value which usually is much larger, and go to only the key object. This would of course only be noticeable if you indeed used a much heavier cached value class.
    The hashCode() and equals() does not matter on
    the filter class<< I'm not so sure since I noticed that these methods
    were implemented in the EqualsFilter class, that they
    are called at runtime and that the performance
    results are better when you add them
    That interests me... In what circumstances did you see them invoked? On the storage node before sending an event, or upon registering a filtered listener?
    If the second, then I guess the listeners are stored in a hash-based map of collections keyed by a filter, and indeed that might be relevant as in that case it will cause less passes on the filter for multiple listeners with an equalling filter.
    DataOutput.writeInt(int) writes 4 bytes.
    ExternalizableHelper.writeInt(DataOutput, int) writes
    1-5 bytes (or 1-6?), with numbers with small absolute
    values consuming less bytes.Similar differences exist
    for the long type as well, but your stamp attribute
    probably will be a large number...<< I tried it but in my use case, I got the same
    results. I guess that it must be interesting, if I
    serialiaze/deserialiaze many more objects.
    Also, if Coherence serializes an
    ExternalizableLite object, it writes out its
    class-name (except if it is a Coherence XmlBean). If
    you define your key as an XmlBean, and add your class
    into the classname cache configuration in
    ExternalizableHelper.xml, then instead of the
    classname, only an int will be written. This way you
    can spare a large percentage of bandwidth consumed by
    transferring your key instance as it has only a small
    number of attributes. For the value object, it might
    or might not be so relevant, considering that it will
    probably contain many more attributes. However, in
    case of a lite event, the value is not transferred at
    all.<< I tried it too and in my use case, I noticed that
    we get objects nearly twice lighter than an
    ExternalizableLite object but it's slower to get
    them. But it is very intersting to keep in mind, if
    we would like to reduce the network traffic.
    Yes, these are minor differences at the moment.
    As for the performance of XMLBean, it is a hack, but you might try overriding the readExternal/writeExternal method with your own usual ExternalizableLite implementation stuff. That way you get the advantages of the xmlbean classname cache, and avoid its reflection-based operation, at the cost of having to extend XMLBean.
    Also, sooner or later the TCMP protocol and the distributed cache storages will also support using PortableObject as a transmission format, which enables using your own classname resolution and allow you to omit the classname from your objects. Unfortunately, I don't know when it will be implemented.
    >
    But finally, I guess that I found the best solution
    for my specific use case which is to use a map
    listener for a key which has no time stamp, but since
    the time stamp is never null, I had just to check
    properly the time stamp in the equals method.
    I would still recommend to use a separate key class, use a custom filter which accesses only the key and not the value, and if possible register a lite listener instead of a heavy one. Try it with a much heavier cached value class where the differences are more pronounced.
    Best regards,
    Robert

  • How do I listen for changes in a container's components?

    I have a JScrollPane that contains a JTextPane. I want any Container that can possibly contain my JScrollPane to be able to listen for changes in the JTextPane's Document.
    For example, at the moment I'm using a JTabbedPane to hold a number of my JScrollPanes and I want to alter the tab title when any associated JScrollPane-JTextPane-Document is updated.
    Any suggestions on how best to handle this?

    I would use a controller object that manages all your gui components (tabs, scrolls, documents, text panes). Your controller object can register as a listener to the appropriate component, and when it changes, update the title of a tab (or do whatever else) as appropriate.
    Never put business logic like this stuff inside the actual gui components. Create, layout, etc. all the gui components (and related components like Document) from another controller like object instead. It makes handling the various listener stuff like this much easier. Read up on MVC (model view controller) stuff for more info.
    As for the actual mechanics, you could get the document that is used in the JTextPane and register as a DocumentListener. As a document listener, you get notified of all changes that are made to that document.

  • My Ipad has been stolen. I need serial number for police

    My Ipad has been stolen. I need serial number for police. How can I find it through Support, iCloud or iTunes?

    You might be able to get it from your account : https://supportprofile.apple.com/
    Or if you have a backup on the iPad on your computer's iTunes : http://support.apple.com/kb/HT4061 - go into Edit > Preferences and on the Devices tab hover your mouse pointer over the iPad's backup

  • Need help in creating tabbed webpart in sharepoint + no of tabs in webpart should be dynamic.

    Need help in creating tabbed webpart in sharepoint and no of tabs in webpart should be dynamic.
    under each tab i should be able to add multiple webparts(each tab will have webpart zone)
    programatically i need to generate tabs and insert webpart zones under each tab.
    Let me  know how can i achieve this.
    i followed below article.
    http://msdn.microsoft.com/en-us/library/jj573263%28v=office.14%29.aspx
    but in this article the tabs and webparts are static and we need to close each webpart .
    Kindly let me know the approach.thanks in advance

    the Easy Tabs could be useful for your requirement
    http://usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/Easy-Tabs-v5.aspx
    /blog
    twttr @esjord

  • Listening for the end of a movie

    Hi, I have some code that loads a movieclip into an empty
    clip
    var container:MovieClip =
    this.createEmptyMovieClip("container", this.getNextHighestDepth());
    container.attachMovie("twdc_mc", "twdc_mc", 1, {_x:300,
    _y:275});
    then i want to wait until the end of the movieclip, unload it
    and load another in its place - all without leaving frame one of my
    main timeline...so my initial thought was to add this:
    function getframes(numFrames,totalFrames) {
    if (numFrames == totalFrames){
    trace("removed") //changed the return variable to this for
    testing
    container.twdc_mc.onEnterFrame =
    getframes(container.twdc_mc._currentframe,container.twdc_mc._totalframes);
    (the use of a function because i want to re-use it)
    the problem is that the if statement is parsed and evaluated
    to false immediately, then it moves on to the next statement
    without looking back despite the existance of the onEnterFrame
    function
    So my question is how can I listen for this event without the
    need to add unLoad or removeMovieClip to the end of the offending
    mc?
    Thankyou in advance for any replies, I'm trying hard to get
    to grips with "as" but Im a php boy at heart and really struggling!
    Sam

    Hi Sam,
    in AS, you can't pass parameters to an event or callback
    function like onEnterFrame this way. You can either pass a function
    reference (without brackets, otherwise the function would execute
    immediately and the event is undefined after that):
    container.twdc_mc.onEnterFrame = getframes;
    or define a function 'on the fly':
    container.twdc_mc.onEnterFrame = function(){
    Since you want to use the first way, getframes() can't have
    any parameters, but instead it can use the scope of the event it is
    bound to through the 'this' keyword:
    function getframes() {
    // trace(this._totalframes);
    if (this._currentframe == this._totalframes){
    trace("removed")
    Now 'this' depends on the scope in which getframes() is
    called, so you can use it with the onEnterFrame event of the loaded
    clip:
    container.twdc_mc.onEnterFrame = getframes;
    and it will compare twdc_mc's position to it's end. Bound to
    another MC it would take that MC's values.
    cheers,
    blemmo

  • I need Java code for a simple graphical hit counter for a webpage

    I was wondering if anybody out there could send me some code for a simple graphical hit counter for a webpage. All the sites that I've visited are garbage and of no use to me. Please help me.
    Colin

    Not as easy as you'd imagine with applets. You need some way to store the hits, usually through a file on the server. That's not gonna happen in a hurry for 2 reasons -
    - Applets can't read/write files
    - Your web server usually won't let you run programs on their machine (ie, programs that listen for socket connections from applets, then load/read/write/close a file).
    In short, no, there is no simple java solution (that I know of).
    Cheers,
    Radish21

  • Issue with setting an Action Listener for a Command Button

    Hi all,
    I'm trying to set an action listener for a CoreCommanButton in a backing bean. Here's my code:
         CoreCommandButton editBtn = new CoreCommandButton();
              MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{backBean.doButtonAct}",null);
              editBtn.setActionListener(mb);
    //Action listener method
         public void doButtonAct(ActionEvent actionEvent)
    I keep getting a javax.faces.el.MethodNotFoundException error. However when I remove the ActionEvent parameter in doButtonAct(), I get a wrong number of arguments error.
    So i'm guessing there is something wrong with the parameters i accept in my action listener method. what can be causing this issue?
    Cheers.

    I figured this out.
    Since doButtonAct() requires an ActionEvent object as a parameter, i needed to define the parameter type when I create the method binding.
    Solution:
         Class argsString[] = new Class[] { ActionEvent.class };
              MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{backBean.doButtonAct}",argsString);

Maybe you are looking for

  • [JS][CS3]Applying Character Style to First Word

    I am a noob as far as Javascript  is concerned, and I was hoping for a little guidance. Here's my scenario: I have a book that has been typeset all in one file; the main content is all in one story. I want to select the first word of every text frame

  • Help Please - Pdf shows/ reads some white pages when opened by some  people

    I have made a pdf book of my artworks ( on a mac) and have a major problem. When I send it out, some people are able to read everything but others get a couple of white blank pages when they view the pdf online or download it or sometimes only either

  • Total Tax in Service Entry sheet

    Hello Is there any way we can bring the total taxes ( which is outputted into the PO using JEXS ) into service entry sheet? non deductible taxes are brought in thru NAVM which is fine. i created a conditon similar to JEXS but the condition is not bri

  • WS2012 Standard R2 with Essentials sudden problem with Server Manager, Essential Dashboard and other services

    Hi all, I have a problem with my Windows Server 2012 R2 with Essential installed. When I try to run Server Manager the server manager window doesn't appear and the same thing applies for starting the essentials dashboard. This leads to that some of t

  • Lose preview files after duplicating sequence

    On CS3, if I duplicated a rendered sequence, the rendered timeline remained intact in the duplicated sequence. In CS4, the renders go away, making it necessary to re-render the timeline. What am I missing? The video preview scratch disc is the same.