How to get an event both in custom component and into its instance

I have a custom component that extends a Jtree
I want to know when a node is clicked both , into my component and after into the component sited into Jpanel
now, I can only detect it into the component, but I dont know how to detect it at the component I have in my Jpanel
I have 'addTreeSelectionListener' in both places ...
xxxxx.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
public void valueChanged(javax.swing.event.TreeSelectionEvent e) { .....
Any help ?
Thanks

tonnot wrote:
Thank you.
I think that a good answer can be ' Revise your code, because there must be a problem' Well, that's the life of a programmer. If you want to post an SSCCE, I'm sure somebody can help if you get stuck.
And ...
Why are you extending JTree? I'd bet you shouldn't be.Why not ? ....
Why SUN develop the 'extends' functionality ? You should use extends if you're changing the behavior of an existing class. An example of this is extending JPanel and overriding the paintComponent() method to do some custom painting.
You should not use extends if you just need an instance of an existing class. An example of this is extending JFrame instead of simply creating a JFrame instance.
Without seeing your code, I can't be sure you're misusing extends. But many people do.
Here's an example.
Bad:
public class MyProgram extends JFrame{
   public MyProgram(){
      setSize(200, 200);
      setVisible(true);
   public static void main(String [] args){
      new MyProgram();
}Better:
public class MyProgram{
   public MyProgram(){
      JFrame frame = new JFrame();
      frame.setSize(200, 200);
      frame.setVisible(true);
   public static void main(String [] args){
      new MyProgram();
}

Similar Messages

  • How to get the event moment after a bottun and 2 validation windows?

    We need to do something after the user press [add] button and after SBO insert OVMP/VMP1. But, right after the [add] button, there are 2 validation windows coming out. I need to get the moment after 2 [ok] selection and OVPM/VPM1 inserting. How to do that?

    Hi Nerow,
    Try using the "pVal.Action_Success" for the item event - after the button is clicked/pressed. This will fire if the add/update logic is handled.
    Let me know if this works.

  • How to get the name of a (custom) component

    Hi,
    I would like to know whether there is a way to get the name Xcelsius uses for instance in the Object Browser. Getting the components "name" property doesnt return this information.
    Thanks in advance.

    String myFileName = request.getRequestURL().substring(request.getRequestURL().lastIndexOf("/")+1);
    or with javascript
    <H1><script>document.write(document.location.href.substring(document.location.href.lastIndexOf("/")+1))</script></H1>
    bye! :)

  • Listening in main application for event coming from custom component

    I have a custom component that im using for a login.  i watch videos and tutorials on how to pass variables between custom components and application. the problem im having is that must tutorials or explanation have you put the event on the custom component and then it refers to some function within the main app.
    Is there a way to just listen on the main app when that event kicks off? ive been trying for hours and i know there has to be something im missing it cant be that hard. any help i would really appreciate.
    Thanks
    Miguel

    Sounds like you're asking about addEventListener():
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                        comp.addEventListener("test", testHandler);
                   private function testHandler(e:Event):void {
                        trace(e);
              ]]>
         </fx:Script>
         <local:TestComponent id="comp"/>
    Add an event listener on your custom component (first string is the 'type' of the event).

  • *** How to get the username in a custom password change routine....

    How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
    We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.

    OK !
    Use that maybe good :
    select USERID into v_user from sys.aud$
      where ntimestamp#=(
      select max(ntimestamp#)
      from sys.aud$ );

  • How to get resume event in app?

    How to get resume event in app?

    Hi,
    Have a look at this
    Windows Phone Application Lifecycle
    I think you are looking about Application_Activated which is explained in detail in the above article.
    Pradeep AJ

  • Gmail... how to get emails in both places?

    Hi,
    I have my blackberry setup to work with gmail.
    I've been noticing that if I get an email on my blackberry it doesn't go to my gmail inbox and vice versa.
    Is there any way to get the emails both on my blackberry and in my gmail inbox?
    Thanks,
    Braden
    Solved!
    Go to Solution.

    Welcome to the forums braden87
    Have you tried deleting and re-adding the email account on your BB email setup site? That may fix the issue.
    Or Send service books to the phone by:
    1. Logging in to your carrier's BIS site (where you setup your email)
    2. Go to Service Books and click "Send Service Books"
    Kijana
    Please remember to:
    1. Mark Accept as Solution on the appropriate post once your issue has been resolved
    2. Give Kudos to helpful posts (click the star next to the post)
    Thanks

  • How to get the contents associated with a component.

    How to get the contents associated with a component.
    Like i have 2 buttons and i want to get the contents associated with these button without clicking them i.e without firing the event.
    By Contents i mean, whatever things we get after firing the event,we get some other window and some thing is added to the current page and so on.

    grab all the code inside the actionPerformed(ActionEvent e) method

  • How to get Music Player to play AAC files and show...

    I feel the need, the need to share my recent experiences with you! Firstly to restate the already known facts: The Nokia Audio Manager in PC Suite is incapable of reading any tags as far as I have seen, from a tag (AAC/MP3) or from a CD itself and it crashes on my pc after sending 2 albums to my phone or on initialising once the phone has 2 albums already on it - so I've binned that. iTunes creates .m4a files which are AAC files but in mp4 containers with mp4 tags. The N70 will play AAC files and read ID3 tags up to v2.3 Here's how to get musak on your N70 with tags and artwork. 1. get yourself copies of dbpoweramp 11.5, their AAC codec (the Release 5 one) and The Godfather and install them 2. Go into the dbpoweramp config, select the ID tag tab and change the tag to ID3V2 for AAC. check the version field is set to v2.3 3. Use Poweramp's CD Input to rip a CD (you can specify under options to use AAC (Advanced Audio Coding (CLI)), you can custom the folder/filenames and set the bitrate (I use 100 BVR which creates files about the same size as MP3) 3.5. Rename any file that has an apostrohpe in the filename - removing the apostrophe - as the Music player will not read the tag 4. Go onto Amazon.com, find your CD and save the artwork image to your PC (create a folder for artwork) 5. Run The Godfather, select the folder containing the ripped album, click on the 'TAG' button, tick the picture box and click the button to it's right and browse for the .jpg file you just downloaded. then click on Update which will bring up the edit dialog, check that the picture is visible at bottom right and is ticked and then click 'Update All', then 'Sync' and then 'Exit'. Finally, click on the 'Apply' button 6. Transfer the folder to your My Music folder on the MMC 7. Run the Music Player and select Options-Update Collection 8. Now go into Albums and you should see your album title. Click on it and you should see all tracks. Click on a track and you should see, in the playing window, the artist & track and the artwork too. It has taken me weeks to get this far but for me, it is worth it. I hope this system works for you too Regards, Brian.

    It sounds like a dud program.   I would remove it (highlight its icon, then Options -> Remove).  If you don't see a remove option, look for the program in the Application Manager.

  • I have 2 icloud accounts how can i see them both on my macbook and iphone

    I have 2 icloud accounts how can I see them both on my macbook and iphone?

    iCloud doesn't have anything to do with texts or phone calls. Those are both tied to your phone number and SIM, not to an iCloud account.

  • The user acct my apple was connected to no longer works (corrupt).  My Apple TV is still synced to that account and all of my recent purchases are going to that username.  Does anyone know how to get all of the purchased items back and to the new user?

    The user profile my appleTV was synced on my computer to no longer works (corrupt).  My Apple TV is still synced to that profile and all of my recent purchases are going to that username.  Does anyone know how to get all of the purchased items back and to the new user (same computer)?  I created a new user on my computer and moved the itunes folder to the desktop but never changed the path to which the apple synced to.  Now I can only see old items I purchased before the user profile went bad.  PLease help!

    Welcome to the Apple Community.
    Changing the library the Apple TV is synced with will delete all synced content from the Apple TV, but it won't delete purchased content.
    You should be able to change the library, resync any content you want and transfer your purchases back to the new library.

  • How do you get music from your Itunes to your computer? im making a wedding video on windows movie maker but cant figure out how to get the bridal music off my ipod and onto my pc.

    Im making a wedding video and cant figure out how to get the bridal music off my itunes and onto my computer.. Im using the windows movie maker

    Marian,
    Let's be clear on one thing here. The manual setting is an iPod setting, not an iTunes one. So, once you've set it to manual (and you appear to have done that correctly), then you can connect it to any number of computers without changing that setting.
    "The grey thing occurs on one pc only"
    This is the thing that I don't understand, if your iPod is set to manual, then it shouldn't happen on any computer. If you connect the iPod that is set to manual to this pc, and then click on it in the source listing, then you would be looking at the songs on the iPod, and they should not be greyed out. When you connect to the "other pc" under these same circumstances, they are not greyed out?

  • Bridge CC keeps crashing on start up but was working last week - Any Ideas how to get it back. Have tried uninstalling and re installing software. All other CC software working fine (Mac)

    Bridge CC keeps crashing on start up but was working last week - Any Ideas how to get it back. Have tried uninstalling and re installing software. All other CC software working fine (Mac)

    Also some problems since the CC2014... For me i can launch bridge but the crash occurs when i try to change access to any bridge preference... i open a discussion about it

  • How to get the floor plan in Webdynpro component ?

    Hi,
    How to get the floor plan in Webdynpro component ?
    Best Regards,
    Tripathi

    Hi,
    Just copy the templates from Webdynpro Component by choosing OIF or GAF or QAF template.
    Regards,
    Bansidahr

  • How to get the query result of improvement (Before and After ) using sql de

    how to get the query result of improvement (Before and After ) using sql developer.

    Check
    http://www.oracle.com/technetwork/articles/sql/exploring-sql-developer-1637307.html

Maybe you are looking for

  • How to retrieve all the data from a BLOB using view-generated accessor

    I am using JDeveveloper 10g v. 10.1.3 and am storing an image in a database as a blob object and need to retrieve all of the data to get the entire image and store it in an ImageIcon. The code I have works partially in that it retrieves the correct d

  • How do I send my BMP info from logic to pedals and keys?

    How do I send my BMP info from logic to pedals and keys? Is it possible to sync my logic bmp with my microkorg so that my korg automatic will sync with the BMP from logic?

  • Line Chart to Compare Current Year vs Last Year

    I am on BI 7 SP9. I need to create a line chart that shows 2 lines to compare  revenue for the current year against last year. The first line should show the revenue for the current year. The second line should show the revenue for last year. In my B

  • Stroke around text boxes??

    Is is possible to give text boxes a stroke?? I am creating a announcement sheet and the previous way they did it was in publisher where they had a background and then a filled text box with a stroke around each one. Thanks, Cory G4   Mac OS X (10.4.7

  • Oracle 9i clob segment possible corruption

    Hello all, We are experiencing some select issues from a table containing a CLOB segment. Since I don't know too much about CLOBs and we are suspecting a possible corruption. What would be the next step besides a DBV on the datafile housing hat table