CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Maharastra, India
    Posts
    32

    Adding Mouse Listener

    Hi Gurus,

    I am using JPanel in JFrame. I added MouseListener, MouseMotionListener to JPanel. Now when i click on the JPanel, mousePressed event is executing. Then i added three JEditorPanes, in the JPanel. When i click on the JEditorPane, in the JPanel my mouseListener is not getting executed. Why this behavi

  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: Adding Mouse Listener

    JPanel is a container. U will get any Event only if u click or do something in JPanel area. When u put a JEditorPane (or any component) in that JPanel, the area enclosing JEditorPane is kind of given to that component. The area excluding all the components in the JPanel is JPanel's area where u get the events.

    If u want to handle events in the area of JEditorPane, u will need to add MouseListener to that component.

    - UnicMan
    http://members.tripod.com/unicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured