How can I relay Events to other Listeners?

Hello,
I'm writing an application consisting of one JFrame that holds 2 JPanels, a Panel with my "Tools" and a Panel that works as "Worksheet". I implented the feature, that you can drag a Tool from the Tools-Panel to the Worksheet-Panel.
Now, additionally, I want to implement the feature in the Worksheet-Panel that you can replace an element by mouseDragged(..). I tried to implement this by using the GlasPane from the JFrame ...
My Problem: The GlassPane seems to catch all events from both Panels and now the Drag&Drop feature from the Tools-Panel don't work any more.
My Question: How can I relay the Mouse-Events catched by the GlassPane to all other MouseEvent-Listeners?
Here my Worksheet-Panel, it add itself to the GlasPane-MouseListener List
public class Worksheet_Panel extends javax.swing.JPanel implements WorksheetInterface {
    public Worksheet_Panel(Component GlasPane) {
         GlasPane.addMouseListener(listener);
         GlasPane.setVisible(true);
    public void mousePressed(MouseEvent e) {
    }Thanks for any help
Edited by: AddForumListener on Feb 10, 2008 4:06 AM

AddForumListener wrote:
thanks. it's an interest method.
but i think that don't work for my situation because the Class where the event is handled don't know which other components has an interest on that event.
I think I will try to create an own glasspane which covers my worksheet-panel and its components.
greetingsI do not know if this will be useful because I did not understand what you are trying to achieve since I did not see your code fully. However you can reach the other components which are interested in listening the mouse events of the source component that created the mouse event. What I mean is you can add the following in the mousePressed method of your glasspane component for instance:
public void mousePressed(MouseEvent e)
     Component source = (Component) e.getSource();
     MouseListener[] listeners = source.getMouseListeners();
     // Iterate through the mouse listeners, determine to which listener
     // you would like to relay the mouse event and relay it as I mentioned above.
     for (int i = 0; i < listeners.length; i++)
} Anyway, good luck!!!

Similar Messages

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • How can I remove events from my iPhone. I want to delete all the events from my iPhone.

    how can I remove Events from my Photo in iPhone

    Connect to computer iTunes and uncheck under Photos > Events then do a sync.

  • Imported old family video, I seperated different events, how can I save event to put together in a menu like family, vacation, christmas.

    Imported old family video, I seperated different events and named each event, how can I save event to put together in a menu like family, vacation, christmas to make a DVD

    revdhayes wrote:
    I imported 5 1 hour old video in Final Cut Pro X. I spent all day seperating clips with Start and end then naming each clip in properties..
    Sorry, but I don't understand  what "5 1 hour video" means.
    I do understand that you have a lot of clips that you want to group by various subjects, like vacation, etc. That's a perfect job for keywords, which perhaps is what you used when you named them?
    If you did use keywords, go to that TL Index and click Tag at the top and then the keyword icon at the bottom. It should give you a list of only clips in that category. Select clip from the menu and it should highlight them. You could then copy and paste them to a new project for export. Repeat as necessary.
    If you're going to do a lot of these, I'd suggest doing this from the event browser, applying keywords and then the clips into separate projects.  But there are always more than one way to do things, and to each his/her own.
    Again, I don't have any idea how long your footage is and whether it is even possible (or desirable) to fit it on to a single DVD. I mentioned iDVD because of its menu and sub menu capabilities. You will need another app like Compressor to do the chapter makers (unless Apple updates FCP before you finish your project and adds that capability. That would be nice,)
    Good luck.
    Russ

  • HT4759 How can make the events listed in my chalenda become automatically a reminder in the reminder?:

    How can make the events listed in my chalenda become automatically a reminder in the reminder?:

    Welcome to the Apple community.
    Calendar and reminders are two different and separate apps, you cannot transfer information between the two of them.

  • How can I count events during a given time with 2 counters (6025 E)

    Hi, How can I count events during a given time (1 sec for example) with 2 counters:
    what is the best way?
    how should i configurate both counter?
    i have done the 1st counter in ev_counter with the gate being the output of the 2nd; and how can i say to the 2nd to trig the first after 1 sec counting? (trig at start and at end) what are the functoins calls in NIDAQ. i am using Visual C++

    Greetings,
    When you perform event counting a gate signal can be added such that if a low signal occurs on the gate, then the counter will pause. When a high signal is seen, the counter will continue counting edges. When you install the NI-DAQ driver you should have installed the examples for Visual C++. The counter examples are found in \Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr. Take a look at STCeventCount.C. Be sure to only use STC examples with your hardware. The E-series boards contain the DAQ-STC chip.
    Now, all you need is a gate signal with a width (high time) of 1 second. You could use an external frequency or pulse generator to do this. Or, you could just use the second counter found on your PCI-6025E board. In this
    case you could configure the second counter to generate a single pulse. Take a look at the STCgenerateSinglePulse.C example. As long as the pulse is in a high state for one second you can use it to gate (or time) your counting of events.
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

  • How can we impliment event pooling table in 11g

    how can we use event pooling table in obiee11g for the cache seeding .could you please share knowledge.
    Regards
    bethamsetty

    Hi,
    Refer-
    http://docs.oracle.com/cd/E14571_01/bi.1111/e10541/querycaching.htm
    see 7.8 section
    http://obieehome.blogspot.in/2012/07/event-polling-in-obiee-11g.html
    Hope this helped/ answered
    Regards
    MuRam

  • How can launch an event in javascript?

    Hi, i´m doing an app in jsp, but i´m using a framework in javascript, css... my problem is... how can launch an event in javascript?
    I have a menu bar in javascript, and i want launch an event in each option, how?
    Thanks,

    Hi Victor,
    well, onMouseUp("blablup");
    I do not finally get your problem - do you want to send an event? So just add it to the URL and send the URL  -or do you want to excut the form? Why then not add the "event" to a hiden field in the form and execut that form then?
    In the handler you can ask for the details of the hidden field.
    I think it is not exactly what you are fter - but it could be that this is anyay a solution.
    Regards,
    Oliver

  • How can i move contacts from other accounts (eg: gmail,hotmail etc) to icloud account.

    Hi All,
    I have setup icloud in my Iphone 6 running 8.1.2. and it is logged in by enabling Contacts in icloud settings. My contact list contains 1718 Contacts. I manually backed up my data into icloud including my contacts without Passbook & Documents data. But when i logged into iCloud.com to see the contacts it is not there.
    I also find when i checked only the Icloud contacts "there are no contacts showing in my contact list". I think this is the reason why there is no contacts in icloud web too. Then how can i move contacts from other accounts (eg: gmail,hotmail etc) to icloud.

    I assume you're using GMail as your primary e-mail account?  Try this.  This is how I am setup.  Not only will it move all your contacts to your phone but any changes made in GMail or on the iPhone will be sync'd with the server.
    http://www.google.com/support/mobile/bin/answer.py?answer=138740
    Note... I think this will delete your existing contacts from your device.  You will want to use iTunes to back them up and get them imported into GMail before you sync your device wtih GMail.

  • How can I get back the other version of itunes?

    It was much easier to use and way more confortable, How can I get back the other version of itunes? It was much easier to use and way more confortable
    I can't pass playlists from itunes to my i-pod, and the sthetic of the new itunes is not a good one.
    Could I get back an older version? those were easier to use, more simplier

    Apple wisely leaves a copy of iMovie version 9 installed in the Application folder when you download version 10.

  • How can I delete the huge "other" section in my storage?

    How can I delete this huge "other" category? I don't even know what is in that category.
    Thank you!

    See -> What is "Other" and what can I do about it?
    Clinton

  • How can I get rid of other files on my mac ?

    how can I get rid of other files on my mac ?

    Hope this helps.
    1. Empty Trash.
        http://support.apple.com/kb/PH10677
    2. Delete "Recovered Messages", if any.
        Hold the option key down and click "Go" menu in the Finder menu bar.
        Select "Library" from the dropdown.
        Library > Mail > V2 > Mailboxes
        Delete "Recovered Messages", if any.
        Empty Trash. Restart.
    3. Repair Disk
        Steps 1 through 7
        http://support.apple.com/kb/PH5836
    4. For more on this and very helpful tips:
        http://pondini.org/OSX/DiskSpace.html
        http://pondini.org/OSX/LionStorage.html
    5. Disk space / Time Machine ?/ Local Snapshots
       http://support.apple.com/kb/ht4878
    6 Re-index Macintosh HD
       System Preferences > Spotlight > Privacy
       http://support.apple.com/kb/ht2409

  • How can i get rid of other folder on ipad

    how can i get rid of other folder on ipad

    You can't remove the "other" section on your iPad, iTunes and the iOS need this folder to store data during syncing for example, damaged data and for all things, that you can't access on your device.
    You can reduce the size by restoring, if the folder grows to more than 1GB due to problems when you sync or download apps or photos.

  • How can I purchase songs from other country?

    How can I purchase songs from other country?

    You cant, because of licensing issues apple wont allow you too purchase songs which they dont have licens too sell in your country.

  • How can I buy ibooks from other countries' bookstores?

    I have a US itunes account. How can I buy books from other countries' itunes bookstores?

    You cannot.

Maybe you are looking for

  • Standard Preview size/quality Lightroom 1.1. (how and what)

    I'm working on a Macbook pro, with hi-res 17" screen 1920x1200. In most manuals, tutorials etc. it says that you can "set the standard preview size fitting for your screen". I'm looking for some more background info on the standard preview, to decide

  • Third party slaes order

    Business Scenario When creating a sales order, the item cat used differentiates the std delivery or delivery from vendor st to customer. We have set the delivery block at the header level which would stop creation of any deliveries but how do we have

  • Screen Enhancement in ME53N transaction

    Hi,   I have developed a Report in which Purchase Requisition is the only field in the Selection Screen.   When it is executed, it calls a smartform and displays the Purchase Requisition Details.   The requirement is I have to add a Pushbutton in ME5

  • First Imac - RAM question

    Hi Ive just bought my first ever Imac, its on its way at the mo, and meanwhile Ive bought 2Gb of RAM to install myself - am I safe to install the RAM as soon as I get the Imac - before having switched it on and set it up? Also I opted for the wireles

  • Replacement DVD drive T430

    I need to replace the optical drive on my wife's Thinkpad T430 and I just want to check compatibility.  Does the same drive fit in the T430s and the T430? Here are some drives I found.  Just don't want to order one and have it not be the right one.