How to catch children events?

Hi all!
I have a problem. I thought it should be easy to implement, but I didn't found solution! :(
The problem is a next one: I have a JFrame that contains some components inside like Panels, Buttons, ... But what I need is a catch all mouse movements inside JFrame even if the event was appeared over these components.
Maximum what I could get is catch mose events over the empty space of JFrame.
Is anybody know how to do it?
Thank you!
Vladimir

Thank you,
That's exactly what I going to do today, but look at this http://forum.java.sun.com/thread.jsp?forum=57&thread=170512&start=0&range=15
That is what I searched for!
Anyway thanks a lot for your cooperation!
Best regards,
Vladimir

Similar Messages

  • How to catch click event on BAR or a BAR GRAPH???

    Hello
    I want to implemnt following things,
    1. there is Bar Graph containing 10 Bars.
    2. So i want to navigate to 10 diff. pages on click of each bar.
    So how to catch click event on BAR or a BAR GRAPH.????

    Hi,
    You can set Destination URI on a graph. The URL can be specifically associated to a particular data point plotted in the graph.
    Detail for the same is provided in OAF developer guide under 'Charts and Graphs' topic.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to catch click event on a link from an applet

    how to catch click event on a link from an applet

    The applet has to call a mouse listener:
    public class Applet extends Applet
                   implements MouseListener, MouseMotionListener
    The mouse methods must be included, here is the one to catch a click
    public void mouseClicked(MouseEvent e)

  • How to catch an event when the user change values in the project information dialog

    hi,
    i would like to know how to catch an event in my C# code when the user change values in the project information dialog?
    taskChange doesn't catch these changes.
    thanks.
    Thanks, Sharon.

    You need to write save button event handler for project information dialog. Link is having same functionality described. 
    http://blogs.msdn.com/b/husainzgh/archive/2011/08/01/hooking-into-the-project-detail-page-ribbon-save-button-without-overriding-out-of-box-functionality-in-project-web-access-for-project-server-2010.aspx
    http://www.projectserver2010blog.com/2010/01/sharepoint-2010-webpart-client-server.html
    kirtesh

  • How to catch the event for change dropdown value in alv

    it has a column output by dropdown in alv. the dropdown type cl_salv_wd_uie_dropdown_by_idx.
    now the problem is if change the dropdown value, i want to catch the event to change another column value.
    how can i do it?

    This part contains other ALV initialization code
    *... init ColumnSettings
      DATA:
            lr_column_settings TYPE REF TO if_salv_wd_column_settings.
      lr_column_settings ?= wd_this->r_table.
      DATA:
            lt_columns TYPE salv_wd_t_column_ref.
      lt_columns = lr_column_settings->get_columns( ).
      DATA:
            ls_column     TYPE salv_wd_s_column_ref,
            lr_col_header TYPE REF TO cl_salv_wd_column_header,
            l_tooltip     TYPE string.
      LOOP AT lt_columns INTO ls_column.
        CASE ls_column-id.
          WHEN 'PLANETYPE'.
            DATA:
                  lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
            CREATE OBJECT lr_drdn_by_key
              EXPORTING
                selected_key_fieldname = ls_column-id.
            lr_drdn_by_key->set_key_visible( abap_true ).
            ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
          WHEN OTHERS.
        ENDCASE.
    ENDLOOP.
      DATA:
            node_info TYPE REF TO if_wd_context_node_info,
            lt_valueset   TYPE STANDARD TABLE OF wdr_context_attr_value,
            l_value       TYPE wdr_context_attr_value.
      node_info = wd_context->get_node_info( ).
      node_info = node_info->get_child_node( 'FLIGHT_INFO' ).
    data : lt_sflight type STANDARD TABLE OF sflight,
           ls_sflight like LINE OF lt_sflight.
    SELECT * from sflight into TABLE lt_sflight.
    LOOP at lt_sflight into ls_sflight.
      l_value-value = ls_sflight-planetype.
      l_value-text  = ls_sflight-planetype.
      INSERT l_value into TABLE lt_valueset.
      ENDLOOP.
      node_info->set_attribute_value_set(
      name = 'PLANETYPE'
      value_set = lt_valueset ).

  • How to catch call events?

    Hi, I'm trying to develop a java application for mobile devices (mobile phones) that should automatically Reject when somebody calls (based on some rules).
    I don't know how to catch the "+call event+".
    Can anyone help me ?

    Hi,
    This is not possible using core Java ME (CLDC + MIDP). You can initiate a call in MIDP 2.0 by using platformRequest.
    The optional JSR 253 makes it possible to do what you want do do, but I haven't seen any devices with this JSR implemented.
    http://jcp.org/en/jsr/detail?id=253
    -henrik

  • How to catch key events in JWindow???

    Can somebody please suggest me how do I catch key events in a JWindow. I tried without success with addKeyListener( ) method. My sample code is attached below. I've j2sdk1.4.2_03 in my PC.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class EventCatcher extends JWindow implements KeyListener {
         public EventCatcher() {
              super();
              Container c = getContentPane();
              setBounds(100,100,400,400);
              c.setLayout(new FlowLayout());
              JButton button = new JButton("Hello");
              c.add(button);
    addKeyListener(this);
    requestFocus();
    setVisible(true);
         public void keyReleased(KeyEvent ke) {
    System.out.println("**************");
         public void keyPressed(KeyEvent ke) {}
         public void keyTyped(KeyEvent ke) {}
         public static void main(String str[]) {
              new EventCatcher();
    Regards,
    Koushik

    Hi GraemeHook!
    This is Khurram. I tried your code on my problem that is 95% like this problem but it could not be solved.
    can u please take view on my code.
    I m trying to move a frame that extends from JWindow on runtime with Key Board Arrow keys. but this only works when I extend this MainApp class from JFrame, but not when from JWindow.
    can u please help me. I also posted my own topic but no one response so found it resambling to my problem.
    hoping to hear from u soon
    you can also tell me at my email address
    [email protected]
    thanks
    ===========================================================
    MainApp.java
    *MainApp.java
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class MainApp extends JWindow {
      static LocationManager appLoc = new LocationManager();
      public MainApp() {
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      public static void main(String[] args) {
       MainApp frm = new MainApp();
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            int width = screenSize.width;
            int height = 45;
              frm.setFocusableWindowState(true);
            frm.setFocusable(true);
            frm.setSize(width, height);
            frm.setLocation(appLoc.setAppAtBottomCentered(width, height));
            frm.setLocation(appLoc.moveAppUpward(100));
            frm.setVisible(true);
      private void jbInit() throws Exception {
        this.getContentPane().setBackground(Color.white);
         addKeyListener(new java.awt.event.KeyAdapter(){
          int moveSpeed = 4;//must be even
          public void keyPressed(KeyEvent e){
            //JOptionPane.showMessageDialog(null,""+e.getKeyCode());
             if(e.getKeyCode() == KeyEvent.VK_SHIFT)
              if(moveSpeed==4)
                moveSpeed = 12;
              else
                moveSpeed = 4;
            if(e.getKeyCode() == KeyEvent.VK_UP)
              setLocation(appLoc.moveAppUpward(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_DOWN)
              setLocation(appLoc.moveAppDownward(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_LEFT)
              setLocation(appLoc.moveAppToLeft(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_RIGHT)
              setLocation(appLoc.moveAppToRight(moveSpeed));
            else if(e.getKeyCode() == 107) {//NUMPAD '+' Key For Vertically Increasing
              setSize(appLoc.increaseSize(0,moveSpeed));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 109) {//NUMPAD '-' Key For Vertically Decreasing
              setSize(appLoc.decreaseSize(0,moveSpeed));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 61) {// '+' Key For Horizontal Increasing
              setSize(appLoc.increaseSize(moveSpeed,0));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 45) {// '-' Key For Horizontal Decreasing
              setSize(appLoc.decreaseSize(moveSpeed,0));
              setLocation(appLoc.updateLocation());
    }====================================================================
    LocationManager.java
    * LocationManager.java
        import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        import java.util.*;
        import java.sql.*;
    public class LocationManager {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        static Point newPoint = new Point();
        static Dimension newDim = new Dimension();
        static Dimension minDim = new Dimension();
        /** Creates a new instance of LocationManager */
        public LocationManager() {
        public LocationManager(int width, int height){
            this.setAppCenteredWithDim(width, height);
        public Point setAppCenteredWithDim(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtTopCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = 0;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtBottomCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = (sHeight-height);
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtRightCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = 0;
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtLeftCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width);
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppUpward(int step){
            newPoint.y -= step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppDownward(int step){
            newPoint.y += step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppToLeft(int step){
            newPoint.x -= step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppToRight(int step){
            newPoint.x += step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Dimension increaseSize(int w, int h){
          minDim.width = 116;
          minDim.height = 56;
          newDim.width += w;
          newDim.height +=h;
          if(w==0 && newDim.height > minDim.height)
            newPoint.y -= h/2;
          else if(newDim.width > minDim.width )
            newPoint.x -= w/2;
          return newDim;
        public Dimension decreaseSize(int w, int h){
          minDim.width = 116;
          minDim.height = 56;
          if(newDim.width > minDim.width )
            newDim.width -= w;
          if(newDim.height > minDim.height)
            newDim.height -= h;
          if(w==0 && newDim.height > minDim.height)
            newPoint.y += h/2;
          else if(newDim.width > minDim.width)
            newPoint.x += w/2;
          return newDim;
        public Point updateLocation(){
          return newPoint;
            //return new Point(this.x, this.y);
    }===================================================================

  • How to catch window event on jApplet

    Could you please let me know, How to catch �activate window� event on Japplet page. I am using the following class.
    public class CtApplet
          extends JApplet
          implements Runnable, ErrorHandlerI could implement the same on Jframe by using the following Api�s. I assume they don�t exist on Japplet.
    this.addWindowListener (��.);
    class ��
          extends java.awt.event.WindowAdapter
        public void windowActivated (WindowEvent e)
            ��..
    }Edited by: samtek on Oct 30, 2007 7:59 PM
    I extened my japplet class from WindowListener, and added function, windowActivated(), But not able to catch the event.

    Hi,
    I would try AWTEventListener; it should work with a JFrame.
    Now I probably could have done this better but I made 2 classes for this.
    HyperFrame to run the applet as an Application and have the Frame handle
    the AWT events, and AWTEventManager to process the Events when running as an Applet. In the future I will probably merge into 1 AWTEventManager.
    https://hyperview.dev.java.net/source/browse/hyperview/www/HyperView299/AWTEventManager.java?rev=1.3&view=markup
    https://hyperview.dev.java.net/source/browse/hyperview/www/HyperView299/HyperFrame.java?rev=1.11&view=markup
    Anyway, omit the View/List specific code and look at the setup; it should work for you. BTW Not ATM multi instance friendly but on my todo list several hundred down.
    You will need to tweak the Thread control as well; probably AWTEventManager is the class to study as it really shows all you need to implement an AWTEventListener
    Good Luck!
    (T)

  • How to catch snapshot event in Acrobat 9

    Hi all
    I scope is catch the snapshot event from acrobt and lanchuing photoshop and paste the snapshot.
    How I can catach the event?
    Thanks in advance
    Regards
    arul

    Not with a script. Maybe a plugin. Try the Acrobat SDK forum...

  • How to Catch the Event when a Row is Selected in Extended value Selector

    Hi All.
    I Want to Call the Action when a perticular row is selected in Extended value Selector.
    How can I do it
    Thanks & Regards
         Kiran

    Hi Kiran,
                  Create a seperate view with the table of records same u are showing EVS because with EVS it is not possible to raise any event.
    So add ths view to a seperate window and open that window instead of EVS .So here you can raise an event becuse it a view.
    Regards
    Padma N

  • How to catch drag event in the title bar of a jframe

    Hi
    I want to catch the drag event in the title bar for jframe, because I have a few more window, dialogs, which I want to move along with my main window
    Thanks

    you can use a listener like tih one below...it works if you don't move to quickly.....
    class SynchroMover extends ComponentAdapter{
      private JFrame master;
      private JFrame[]slaves;
      private int currentX;
      private int currentY;
      public SynchroMover(JFrame master,JFrame[]slaves){
        this.master = master;
        this.slaves = slaves;
        currentX =(int) master.getLocation().getX();
        currentY =(int) master.getLocation().getY();
      public void componentMoved(ComponentEvent e){
        int dx = (int)master.getLocation().getX() - currentX;
        int dy = (int)master.getLocation().getY() - currentY;
        System.out.println(dx+" "+dy);
        for(int i=0;i<slaves.length;i++)
          slaves.setLocation((int)(slaves[i].getLocation().getX()+dx),(int)(slaves[i].getLocation().getY()+dy));
    currentX = (int)master.getLocation().getX();
    currentY = (int)master.getLocation().getY();
    the code isn't optimized...so you can probably do better

  • How to catch key events

    Hello!
    I have a component which extends JPanel. Now I dynamically add a JTextField as a child to this component. The problem is: when the textfield has focus, how can I get key events in my panel before the textfield gets them (and maybe intercept them so that the textfield doesn't get them at all)?
    Background: the component is a self written table and the textfield is an editor. Now I have to make sure that when I am editing and press e.g. "cursor up", that not the textfield will get this key event but the table (which should traverse the current cell then ...)
    The problem is: I cannot change the textfield (extend it or something) because a possible solution has to work with any java awt "Component" (or at least with JComponent).
    Any help very appreciated.
    Michael

    Hello,
    implement the keyListener interface for the Extended component...
    and in Keypressed method
    keyPressed(keyEvent){
    // do all ur reuirements here
    //and comsume the keyEvent...
    hope this helps

  • How to catch a event by button personalization

    Hi,
    I added a button in a standard page by Personalization. On click of button, I need to do some validations.
    As this is not a “Submit Button”, I cannot get the event in processFormRequest.
    So I need to define a event by setting “Action Type” as “Fire Partial Action”.
    But in Personalization structure where I added a button, this option of defining a event is not there.
    So what is the procedure to fire a event through button in case of personalization?
    Please help. Thanks in advance.

    Girish,
    This is basically javascript function to submit page.I have used it many times, haven't faced any problem.
    Your problem, seems to be irrevelant of this.Just in your new page remove this javascript function and then run with submit button, still you should get the same error, essentially your error says " Object name for type View Object is invalid." which has nothing to do with javascript function.
    You don't have to enter anything for defaultformname, just keep it as it is. This function will just submit the page with parametre XXX value as "abc".Also remember attach this function only to item of "button" type and not "submit button" type.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to catch the event when a MovieClip is visible/invisible?

    Is there event for that e.g. activate/deactivate? Thanks,

    there's are events for when a movieclip is added and removed from the display, but not for the visible property.

  • How to catch the event Key "F2" pressed

    Hi all,
    Is there someone who can help me please.
    I try to find the event F2 pressed.
    Thanks for your help.
    Laetitia

    Hello Laetitia,
    F2 key seems to be a menu event, and not an item event.
    it's menu event number 6402
    Sebastien

Maybe you are looking for

  • How to create an Invoice in delivery screen?

    Hi everybody. I am trying to create an invoice in the delivery screen, but i am getting an error "-5002 Invalid total[OINV.DocTotal]". Can anyone tell me how to solve this ? here is my code Dim sNewObjCode As String         Dim i As Integer         '

  • Download internal table value to local file from BSP

    Dear all I ve converted a word file to XML and doing some modifications with the help of ABAP program .After that am replacing some of the fields by passing values.after that i am getting the same file to the local system.All these i am able to do in

  • Using Time Machine strictly in manual mode

    Hi again; Just a quick question; I'm using TM strictly manually and never in automatic mode where the (hourly-daily-weekly) backups are initiated by TM. I've set TM up with an initial backup then I turn it off, disconnect it from the system and pull

  • Use of PS-Module: Cost object discussion

    Hello, i have a question regarding the use of PS-Module. I would like to know if in your company you experienced any problem (in controlling or somewhere else) when posting to a variety of different cost objects. For example: wbs-element, sales order

  • Question on web.xml and login

    Hi all I am doing a web-based project, registered user need to log in before they view the member area pages. I have created a directory, called "client", in the Tomcat 4.1.24/webapps/ROOT/client I have put a index.html in the client directory. This