{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Topcomponents Lookupevents And Lookuplisteners","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"topcomponents-lookupevents-and-lookuplisteners","__idx":0},"children":["Topcomponents Lookupevents And Lookuplisteners"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"topcomponents-lookupevents-and-lookuplisteners-1","__idx":1},"children":["TopComponents, LookupEvents and LookupListeners"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-tutorial"},"children":["tutorial"]}," has described how to extend INTViewer programmatically. Here is a brief explanation of the NetBeans/Swing objects involved:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"topcomponents","__idx":2},"children":["TopComponents"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A org.openide.windows.TopComponent is an embeddable visual component to be displayed in NetBeans. This is the basic unit of display--windows should not be created directly, but rather use this class. A top component may correspond to a single window, but may also be a tab (e.g.) in a window."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the tutorial, the \"traceInfo\" window is a TopComponent object. The traceInfoTopComponent object ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["extends"]}," org.openide.windows.TopComponent."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["More information about ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-apis-for-windows/creating-a-topcomponent-window"},"children":["creating and manipulating TopComponent windows"]}," is available."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"lookupevents","__idx":3},"children":["LookupEvents"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A org.openide.util.LookupEvent describes a change of selection."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a current selection is changed, an object of the type org.openide.util.LookupEvent is created."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"lookuplisteners","__idx":4},"children":["LookupListeners"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A org.openide.util.LookupListener is a listener for changes in lookup."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a new layer is loaded, the \"traceInfo\" window automatically displays the number of traces found. To achieve this result, the \"traceInfo\" needs to detect that a new layer was loaded."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This detection is implemented in three places in the implementation of traceInfoTopComponent:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The traceInfoTopComponent object registers the Lookup Listener (see implementation in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-basics/windows-and-layers"},"children":["Layers and Readers"]},") to indicate that it should be informed of changes in selections"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The traceInfoTopComponent object ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["implements"]}," org.openide.util.LookupListener,"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The traceInfoTopComponent object ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["overrides"]}," the resultChanged(LookupEvent evt) method of org.openide.util.LookupListener to act upon that change"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["More information about ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/window-and-layer-selection"},"children":["window and layer selection"]}," is available."]}]},"headings":[{"value":"Topcomponents Lookupevents And Lookuplisteners","id":"topcomponents-lookupevents-and-lookuplisteners","depth":1},{"value":"TopComponents, LookupEvents and LookupListeners","id":"topcomponents-lookupevents-and-lookuplisteners-1","depth":2},{"value":"TopComponents","id":"topcomponents","depth":3},{"value":"LookupEvents","id":"lookupevents","depth":3},{"value":"LookupListeners","id":"lookuplisteners","depth":3}],"frontmatter":{"title":"Topcomponents Lookupevents And Lookuplisteners","pageId":"intviewer-basics/topcomponents-lookupevents-and-lookuplisteners","seo":{"title":"Topcomponents Lookupevents And Lookuplisteners"}},"lastModified":"2026-10-22T14:32:05.576Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/intviewer-basics/topcomponents-lookupevents-and-lookuplisteners","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}