Dispatching Events on overlapping Components

Hello,
i use a layered pane that contains some custom components. How can I make that two overlapping components that reside in the same layer both receive a mouseEvent?
At the moment, only the Componet above receives the event - I know I can pass an Event with dispatchEvent - but i don't know the instance of the component to which to pass it of course... Is there any method to dispatch the event without having to know to which component to pass it?
Any help appreciated.
Best regards & Thanks.
alex

You can use use EventQueue.postEvent to post the event, but it requires source and if it is mouse event it will be later retargeted to correct components according to coordinates. So the only way for you to do this is to find the components by yourself and call processMouseEvent on it.

Similar Messages

  • Help with dispatching JTable event to underlying components in a cell.

    Hello..
    I have a JTable in which i show a panel with clickable labels.. I found that jTable by default doesnt dispatch or allow mouseevents to be caught by underlying elements..
    i need help with dispatching an event from jTable to a label on a panel in a jTable cell.. below is the code i have come up with after finding help with some websites. but i couldnt not get it right.. my dispatched event seems to go back to the jtable itself ..
    any help or suggestion is appreciated..
    Thanks
    'Harish.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.table.*;
    * @author  harish
    public class tableDemo extends javax.swing.JFrame {
        JTable jTable1;
        testpane dummyPane;
        /** Creates new form tableDemo */
        public tableDemo() {
            initComponents();
            //table settings
            String[] columnNames = {"Task", "Action"," "};
            Object[][] data = { };
            DefaultTableModel model = new DefaultTableModel(data, columnNames) {
              // This method returns the Class object of the first
              // cell in specified column in the table model.
            public Class getColumnClass(int mColIndex) {
                int rowIndex = 0;
                Object o = getValueAt(rowIndex, mColIndex);
                if (o == null)
                    return Object.class;
                } else
                    return o.getClass();
            jTable1 = new javax.swing.JTable(model);
            jTable1.addMouseListener(new MouseAdapter(){
              public void mouseClicked(MouseEvent e){
                  System.out.println("Clicked");
                  handleTableMouseEvents(e);
                 //invokeExternalApp("http://www.pixagogo.com");
              public void mouseEntered(MouseEvent e){
                  System.out.println("Entered");
                  //handleTableMouseEvents(e);
              public void mouseExited(MouseEvent e){
                  System.out.println("Exited");
                  //handleTableMouseEvents(e);
            jTable1.setRowHeight(100);
            jTable1.getTableHeader().setReorderingAllowed(false);
            jTable1.setBackground(new java.awt.Color(255, 255, 255));
            jTable1.setGridColor(new Color(250,250,250));
            jTable1.setShowGrid(true);
            jTable1.setShowVerticalLines(true);
            jTable1.setShowHorizontalLines(false);
            jTable1.setFont(new Font("Arial",0,11));
            jTable1.setMaximumSize(new java.awt.Dimension(32767, 32767));
            jTable1.setMinimumSize(new java.awt.Dimension(630, 255));
            jTable1.setPreferredSize(null);
            jTable1.setBackground(new Color(255,255,255));
            int vColIndex=0;
            TableColumn col = jTable1.getColumnModel().getColumn(vColIndex);
            int width = 100;
            col.setPreferredWidth(width);
            //add item to 2nd cell       
            Vector vec = new Vector();
            vec.addElement(null);
            dummyPane = new testpane();
            vec.addElement(dummyPane);
            ((DefaultTableModel)jTable1.getModel()).addRow(vec);
            jTable1.repaint();
            this.getContentPane().add(jTable1);
            jTable1.getColumn("Action").setCellRenderer(
              new MultiRenderer());
        protected void handleTableMouseEvents(MouseEvent e){
            TableColumnModel columnModel = jTable1.getColumnModel();
            int column = columnModel.getColumnIndexAtX(e.getX());
            int row    = e.getY() / jTable1.getRowHeight();
            testpane contentPane = (testpane)(jTable1.getModel().getValueAt(row, column));
            // get the mouse click point relative to the content pane
            Point containerPoint = SwingUtilities.convertPoint(jTable1, e.getPoint(),contentPane);
            if (column==1 && row==0)
            // so the user clicked on the cell that we are bothered about.         
            MouseEvent ev1 = (MouseEvent)SwingUtilities.convertMouseEvent(jTable1, e, contentPane);
            //once clicked on the cell.. we dispatch event to the object in that cell
         jTable1.dispatchEvent(ev1);
        private void initComponents() {
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-528)/2, (screenSize.height-423)/2, 528, 423);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new tableDemo().show();
        // Variables declaration - do not modify
        // End of variables declaration
        class testpane extends JPanel{
            public testpane(){
            GridBagConstraints gridBagConstraints;
            JPanel testpane = new JPanel(new GridBagLayout());
            testpane.setBackground(Color.CYAN);
            JLabel lblTest = new JLabel("test");
            lblTest.addMouseListener(new MouseAdapter(){
              public void mouseClicked(MouseEvent e){
                  System.out.println("panelClicked");
              public void mouseEntered(MouseEvent e){
                  System.out.println("panelEntered");
              public void mouseExited(MouseEvent e){
                  System.out.println("panelExited");
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
            testpane.add(lblTest,gridBagConstraints);
            this.add(testpane);
    class MultiRenderer extends DefaultTableCellRenderer {
      JCheckBox checkBox = new JCheckBox();
      public Component getTableCellRendererComponent(
                         JTable table, Object value,
                         boolean isSelected, boolean hasFocus,
                         int row, int column) {
        if (value instanceof Boolean) {                    // Boolean
          checkBox.setSelected(((Boolean)value).booleanValue());
          checkBox.setHorizontalAlignment(JLabel.CENTER);
          return checkBox;
        String str = (value == null) ? "" : value.toString();
        return super.getTableCellRendererComponent(
             table,str,isSelected,hasFocus,row,column);
        return (testpane)value;
    class MultiEditor implements TableCellEditor {
      public MultiEditor() {
      public boolean isCellEditable(EventObject anEvent) {return false;}
      public boolean stopCellEditing() {return true;}
      public Object getCellEditorValue() {return null;} 
      public void cancelCellEditing() {}
      public boolean shouldSelectCell(EventObject anEvent) {return false;}
      public Component getTableCellEditorComponent(JTable table, Object value,
                  boolean isSelected, int row, int column) {
        if (value instanceof testpane) {                       // ComboString
          System.out.println("yes instance");
        return null;
      public void addCellEditorListener(javax.swing.event.CellEditorListener l) {
      public void removeCellEditorListener(javax.swing.event.CellEditorListener l) {
    }

    any help on this.. anybody. ?

  • Overlapping components problem

    Hello,
    I have been developing an applet for Quickplaces. Basically it shows what is happening in the Quickplace from different kind of views. A view from a document where people can see who has been viewing it for example. Or a view from a member where one can see what documents the member wrote.
    Now I have chosen to implement a sort of circle visualisation for this. In the center is the object the view is about, a document, a member, etc. Outwards are other objects. In the case of a document view, the members that responded to it, in a circle more outward: members that viewed it. Etc. It's sort of a dartboard.
    I have written a custom layoutmanager for each view for this. A problem I have encountered is that once I tell a member or document component to let itself be placed by the layout managerr I get a fixed size component. It looks ok until you for example hover over it, wich I have keyed to a zooming in on details method. When you do that your usually overlapping other components. Why, components can be overlapped without zooming in some views. The problem is the mouselistener I have attached fires when I hover over de component size. Not the size of the actual graphical representation. My members for example are represented by a sphere. They are bounded by a rectangle component though. So if I enter my mouse anywhere near the sphere... it already zooms in, resulting in the user zooming in on a member, but actually he wanted to zoom in on a member that was close to this one, but for the code was "underneath" the component of the other member.
    It's a bit hard to explain without posting a screenshot.
    How do I fix this?

    Hi,
    I need a clarification, taking the example you
    provided:
    you have a rectangle components, that display spheres.I have a viewer class for document's member's and room's. RoomViewer, MemberViewer, etc. These paint the actual graphic. They are given a size by the custom layoutmanager i wrote like this:
            //Layout members
            int mems = members.size();
            if(mems != 0){
                double angle = 360 / mems;
                double baseAngle = 0;
                synchronized(members){
                     Iterator iter = members.iterator();
                     while(iter.hasNext()){
                         MemberViewer tempMember = (MemberViewer)iter.next();
                         Dimension d = tempMember.getSize();
                         double lastLog = tempMember.getMember().getLastLog() * 160 + Math.sqrt((Math.pow(50, (double)2) + Math.pow(50, (double)2)));
                         int xCoord = (int)((xCenter + (Math.cos(Math.toRadians(baseAngle)) * lastLog)) - (0.5 * d.getWidth()));
                         int yCoord = (int)((yCenter + (Math.sin(Math.toRadians(baseAngle)) * lastLog)) - (0.5 * d.getHeight()));
                         tempMember.setBounds(xCoord, yCoord, container_size, container_size);
                         baseAngle += angle;
            }A viewer get's it's data from the model class. MemberViewer from Member, etc.
    First you want to zoom only when the mouse is hovered
    on the sphere. Is that right ?Yes I have implemented the enters part of the mouselistener. As soon as the mouse enters the component in wich the graphical representation is drawn it zooms. with zoom I multiply the size by some and add some different graphs inside the circle, but that is not important. What is interesting is probably that the size of the component when it is not zoomed is the size for when it is zoomed in, or the zoom in would be cut off by the component boundaries.
    What about the overlapping ? could you clarify a bit
    please.
    Basically it overlaps nicely on the view. Once you interact though I get stuck. Clicking, entering and exiting is supposed to do things. But all these 3 fire when your mouse does that thing inside the component, not inside the graphical representation. So you start zooming quite a bit away from the circle of a member btw, because that distance is already part of the component, but not of the drawing.
    Who is reponsible for drawing the shapes ?The Viewers paint themselves. The Layoutmanager gives them a basic place to start their own painting and a View class controls the layoutmanager.
    And who listens to mouse motion ?The viewers themselves do. They implement mouseListener.
    in mouseMoved(MouseEvent e)
    you can get the point with e.getPoint(); where the
    mouse points to.
    This will help you to handle the event only when
    hovered on the shape,
    but it will maybe not solve the hovering over
    overlapped components.I don't quite follow that. A Shape can still not implement MouseListener.

  • I can't get ical events to overlap

    I can't get ical events to overlap. I prefer overlap as opposed to side-by-side. Help as to how to get overlap?

    Make sure you are filing in the "Repeat" and "End date" fields for the event (on the Edit pane).

  • Background events cover overlapping events that are in the foreground.

    Background events cover overlapping events that are in the foreground.
    When I have 2 overlapping events, clicking on one to bring it to the foreground keeps the text of the background event visable and obfuscates the froeground text.
    Anyone else seeing this?

    I'm not familiar with the manner in which TimeLog creates its vCal records in iCal, though I've seen what may be similar problems involving iSync with the records in iCal which are automatically created by the Address Book. Of a set of 27 records, for example - all of which were created by entering a contact's birthday in their Address Book record, and all of which appear identical in iCal - only three would ever synchronize.
    Because all of them synchronize properly with The Missing Sync, which replaces iSync and the iSync Palm Conduit for synchronizing Palm devices, I confident that the problem is not with the Address Book or with iCal, but rather, with iSync itself. In addition to reproducable problems with iSync itself and with the iSync Palm Conduit, there are clearly some problems with the underlying Sync Services mechanism.
    Sync Services is a complex technology, which baffles even developers at times. A recent undocumented change to it under Mac OS X 10.4.3, for example, modifies the push-pull mechanism for groups of changed and unchanged records in such a way that if any unchanged records are associated with changed records in a specific group, the unchanged records may be strippped away - and therefore deleted - during a synchronization event. That is obviously not supposed to happen. Three changed and two unchanged records in a group of five should remain intact: the two unchanged records should not be deleted, but reportedly are under some circumstances.

  • [Embed(source="...   And dispatching events and trace commands not working

    Hi,
    I have a main swf that Embeds another swf.  In the embedded (child) swf I have trace commands and it dispatches events. 
    I embed the child swf like this:
    [Embed(source="../assets/child.swf", symbol="ChildMC")]
    public var ChildMC:Class;
    var child_mc = new ChildMC();
    child_mc.addEventListener(Event.COMPLETE, childComplete);
    addChild(child_mc);
    function childComplete(event:Event):void
    at the end of the timeline in the child swf I have: dispatchEvent(new Event(Event.COMPLETE));
    When I test the main swf, I can see the child swf, but the main swf can't catch any of the dispatched events and I don't get any trace commands from the child swf.
    How can I catch events from an embedded swf?
    thanks!

    I did a quick sample with two fla's.
    The first loads in a child swf and then calls a funtion on the main timeline:
    var url:String = "loadTestChild.swf";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
    loader.load(urlRequest);
    addChild(loader);
    function loader_complete(evt:Event):void {
       evt.currentTarget.content.callMeFromParent();
    The child swf has this code on the main timeline:
    function callMeFromParent ():void {
              trace ("called from parent whoop");
    Running the parent, the trace is called.
    So with this you should be able to call any function you have in the child from the parent.

  • I try to create an html for IPad. The html page contains an element overlapping a video, now it works as for view but the focus is still with video. This denies the event of overlapping element from occuring. Can please anyone help to solve this issue?

    I try to create an html for IPad. The html page contains an element overlapping a video, now it works as for view but the focus is still with video. This denies the event of overlapping element from occuring. Can please anyone help to solve this issue?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • On-dispatch-event trigger related to mscomm (load weight from weight scale

    aoa!
    please guide me to pick weight from weight scale.
    i m using mscomm32 ocx for this purpose.
    clarify the role of on-dispatch-event trigger and specify all events
    regarding mscomm and also explain how to trap events for accomplish
    task.
    thanks in advance.
    Tool used:developer 6i & oracle 10g windows xp(sp2)professional.

    Thanks, but I've already seen this thread and done the steps described on it.
    Actually, my question is very specific... How to populate the fields LinkVal and LinkUnit of the registry...
    I read all the threads here in SDN and they don't answer my question...
    I'd be glad if someone had already done tcode HUPAST works for Filizola...
    Tks again.

  • Questions on Dispatching events

    Hey all,
    I have been trying to get a grasp on dispatching events and have a few questions I am hoping you will all be nice enough to clearify for me.
    Do I have to have a custom Event class to dispatch a custom event?
    If so do I have to create a new intance of the event each time I want to dispatch an event. Example:
    dispatchEvent(new MyEvent(MyEvent.TASK_COMPLETE));
    or can I just dispatch an event once an instance has already previously been created.... example:  dispatchEvent(MyEvent.TASK_COMPLET);?
    Thanks,

    hi
    if you dont need to pass any data along with the event then you dont need a custom event, you can just use a custom event name. eg: dispatchEvent(new Event("myEventName"));
    if you want to dispatch the same event multiple times, you can (but not sure why you would want to do that?), eg:
    var e:Event = new Event("myEventName");  [or new MyCustomEvent("myCustomEventName", myCustomData) ]
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);

  • Dispatching events from JNI

    I've got an application that is trying to watch for mouse events anywhere and everywhere. The goal is to be in-the-know when there is mouse activity going on in general, with the Java app running in the taskbar.
    I have determined that I'll likely need JNI to accomplish this, as paying attention to mouse activity over the whole operating system is somewhat operating system dependent. : )
    Nevertheless, I'd like Java code to handle the events, and I can't seem to find any way for JNI to dispatch events back to the Java side of things. My hope was to catch the events thrown by the system in C/C++ and then simply dispatch them again to act as a middle-man.
    If anybody can tell me how I might accomplish this using JNI, or even a step in the right direction, I would greatly appreciate it. Or, if I'm barking up the wrong tree, please please let me know.
    Thanks,
    - J

    Steps in order
    1. Determine how to capture the events in C/C++. There is no java in this step.
    2. Write an API in C/C++ that models the functionality that you want to use in java. There is no java in this step.
    3. Write java/jni that uses the API in 2. There is java in this step.
    As a callback you will need to use the jni attach thread method.
    You better be careful as messing up on any of the steps above can render your mouse inoperable for the entire OS, so learn the keyboard shortcuts.
    I think that someone posted code like this in the past. I could be mistaken however.

  • Dispatching event from Javascript

    Can I dispatch events from javascript to flash player? I am trying to do so by calling dispatchEvent() on flash player dom object but the event is not passing inside flash player. Any links or clue?

    To be specific ... I can catch a right click and supress it. But I want to send it to flash (lets say) as a left click. Problem is when i do that, javascript listner for dom element will get fired for left click but there wont be any events in flash.
    SO the question is can i fire events on flash from outseide or is it outside the public APIs?

  • Dispatching events between different classes

    Im trying to dispatch and event from an XML class.
    dispatchEvent(new Event (XMLClass.INDEX_CHANGED));
    and catch it in the display class
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    I know that im missing something because the application works
    and the function runs but its not dispatching the event the event
    or maybe it's not catching the event in the display class, even though everything else is working
    and im not gettin' any errors.

    that's exactly what i did.
    i have 3 classes
    AS.XMLClass
    AS.ControlClass
    AS.DisplayClass
    It's like a slideshow thing.
    I have a button on stage thats connected to the control class and every time you press it
    it changes the index of the image in the xmlclass and everytime that the index is changed the xmlclass needs to
    dispatch and event that the index has changed and the display class is going to catch the event and change the image
    everything is working except the xmlclass dispatch event or the displayclass catch event
    XMLCLASS
    public static const INDEX_CHANGED:String = "indexChanged";
    private function dataLoaded(event:Event):void{
                trace("xml file is loaded");
                data = new XML(loader.data);
                dispatchEvent(new Event(XMLClass.XML_LOADED));
                totalItems = data.images.photo.length();
                setCurrentIndex(currentIndex);
    CONTROL CLASS
    import AS.XMLClass;
    private var _xml = new XMLClass();
    public function leftButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex - 1);
            public function rightButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex + 1);
    DISPLAY CLASS
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    public function swapImage(event:Event){
                trace("working....");

  • Help dispatching events from glassPane to other components

    Hi guys,
    I laready did a search in the forum but everybody seems to have trouble blocking events via GlassPane.
    For me it is the opposite.
    I set a glassPane on the Frame via setGlassPane()... works great but now i can't dispatch the events to the rest of the UI. Can someone please give me some example code how to do that;
    Here is what i have tried :
    myFrame.this.getGlassPane().addMouseListener(new MouseAdapter()
    public void mouseClicked(MouseEvent e)
    Frame.this.getRootPane().dispatchEvent(e);
    public void mousePressed(MouseEvent e)
    Frame.this.getRootPane().dispatchEvent(e);
    public void mouseReleased(MouseEvent e)
    Frame.this.getRootPane().dispatchEvent(e);
    public void mouseEntered(MouseEvent e)
    Frame.this.getRootPane().dispatchEvent(e);
    public void mouseExited(MouseEvent e)
    Frame.this.getRootPane().dispatchEvent(e);
    Please show how it is done ...

    Hey Tom,
    You know what's funny, i read that article already and even look at the code but it was too complicated for me...And now that you mentionned it again i decided to look at it again and took one method out of it and now it seems to work but i still don't quiet understand what it does exactly??? Thanks For pushing My Back :)
    Any Other way to do that ???
    private void redispatchMouseEvent(MouseEvent e)
    Point glassPanePoint = e.getPoint();
    Container container = this.getContentPane();
    Point containerPoint = SwingUtilities.convertPoint(this.getGlassPane(), glassPanePoint,container);
    //The mouse event is probably over the content pane.
    //Find out exactly which component it's over.
    Component component =
    SwingUtilities.getDeepestComponentAt(
    container,
    containerPoint.x,
    containerPoint.y);
    if ((component != null) )
    //Forward events over the check box.
    Point componentPoint = SwingUtilities.convertPoint(
    this.getGlassPane(),
    glassPanePoint,
    component);
    component.dispatchEvent(new MouseEvent(component,
    e.getID(),
    e.getWhen(),
    e.getModifiers(),
    componentPoint.x,
    componentPoint.y,
    e.getClickCount(),
    e.isPopupTrigger()));

  • Dispatching events...

    Hi,
    I am working on a project for a system that will not have a mouse. Ideally I would like the screen to function almost like a video game would -- even though it is not a game. By this I mean that all keystrokes are handled at the window level and dispatched to the correct component depending on the keystroke.
    Currently I have inhibited the ability of components on the form to gain focus. When I press a key, the listener associated with the JFrame responds... I then attmpt to use dispatchEvent inside of a case statement to route events to the proper components (In this case a JTextField) The problem is, is that allthough the dispatchEvent call is made, the JTextField doesn't do anything with it. I am just typing characters so I would expect all these keystrokes to show up in the JTextField, but it does not work.
    Does anybody know why this might not work?
    -Benjamin

    Here is a code snippet that actually seems to work. The problem was that I was dispatching a keyPressed event rather than a keyTyped.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    class NoFocus extends JFrame implements KeyListener {
       private class JTextFieldNF extends JTextField {
          public JTextFieldNF(int size) {
             super(size);
          public boolean isFocusTraversable() {
             return false;
       JTextFieldNF tfnf;
         public NoFocus() {
          tfnf = new JTextFieldNF(20);
          getContentPane().setLayout(new FlowLayout());
          getContentPane().add(tfnf);
          addKeyListener(this);
         public void keyPressed(KeyEvent evt) {
       public void keyTyped(java.awt.event.KeyEvent evt) {
          switch (evt.getKeyCode()) {
             // Route up and down key somewhere else
             case KeyEvent.VK_UP:
             case KeyEvent.VK_DOWN:
                break;
             // All keystrokes not expicitly used are piped to tfnf
             default:
                      tfnf.dispatchEvent(evt);
       public void keyReleased(java.awt.event.KeyEvent A) {
         public static void main(String args[])
              JFrame frame = new NoFocus();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.setSize(200,200);
              frame.setVisible(true);

  • Dispatch event from the main App file

    Hi,I have one simple question.I know how to dipatch events from the some of the components files to the main App file,but I don't know how to do the opposite?
    I have an HTTPService with id = "getData" in some component file and I want to dispatch an event that will send it getData.send();
    Is this possible,and it if is how?

    It is possible but not a recommended practice.
    Worst case you proxy out methods on your components and call directly:
    maiAPpp.someComponent.doSomething();
    SomeComponent
    doSomething();
        someOtherComponent.doSomething();
    SomeOtherComponent
    doSomething();
        servcie.send();
    My 2 cents are too look into MVC architecture and have the service inside a command which gets treiggered by a controlled which reacts to your event dispatched by the view.
    C

Maybe you are looking for

  • Writing to File wrong

    Ok, I'm trying to write kind of a calendar program to practice on what I have learned so far. Everything compiles correctly, but the data that is stored to my Schedule.dat file is wrong :-/ For instance, I have my schedule class ask: How many days ar

  • MTOM with XI

    hello does any one know what are the adjustments that the XI needs to do (if he needs) in order to recieve a WS that send message as/with MTOM? does any one has an example of MTOM XOP message? I know it looks like a soap message, I am just not famila

  • Can QT Player play streaming .asx files from the Web?

    All: I'm trying to play some of the flash video files from this site: http://www.adultswim.com/williams/bump_music/index.html I'm certain the links work because those movies play fine on a PC. Yet on my Macs (a Mac Pro and a Macbook), when I click on

  • Program Logic & Java Graphics

    can anyone provide the source code how to create a ticket system. The system should have 2 category, adults and children with a pulldown menu for how many adults or children and calculate the total price of the ticket. example: Adult/$2.00 (the pulld

  • Error after schudling report for triggring proxy

    Hi friends, In the scnario proxy-jdbc.. i have moved the interface to production and schudled the abap report in background jobs. now when the report is triggered the proxy is called and here i am getting this error. INTERNAL.CLIENT_RECEIVE_FAILED Er