listen « Event « Java Swing Q&A





1. My (Java/Swing) MouseListener isn't listening, help me figure out why    stackoverflow.com

So I've got a JPanel implementing MouseListener and MouseMotionListener:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class DisplayArea extends JPanel implements MouseListener, MouseMotionListener  {
    public DisplayArea(Rectangle bounds, Display display) {
  ...

2. Is it possible to have a MouseMotionListener listen to all system mouse motion events?    stackoverflow.com

My boilerplate listener:

class MyMouseMotionListener implements MouseMotionListener {
public void mouseDragged(MouseEvent e) {
 System.out.println("Dragged...");
}

public void mouseMoved(MouseEvent e) {
 System.out.println("Moved...");
}}
Simple enough, but what do I add it to in order to listen to system-wide ...

3. Listening for new child components in Swing    stackoverflow.com

I have a specific requirement that all children of a particular JComponent have double buffering turned off. I can recurse through it easily enough and disable them when needed, but I'd ...

4. Listening to key events for a component hierarchy    stackoverflow.com

I have a Swing app that needs to display different sets of controls based on whether the control or alt keys are pressed. I added a KeyListener to the main ...

5. How can I listen for key presses (within Java Swing) accross all components?    stackoverflow.com

I would like to listen for key combinations such as "Control+S" without adding key listeners to each component in my swing application. How can I achieve this?

6. Attach to another JVM and listen for events? Possible?    stackoverflow.com

I am trying to write a small internal tool to use for debugging focus problems in Swing applications. Right now the debugger tool is built in to the app and enabled ...

7. listening for key/mouse events    stackoverflow.com

Is it possible to listen for key and mouse events without having a gui selected by the user? I want to make a program that runs in the background without a ...

8. How to change which Component is listening for events    stackoverflow.com

I'm trying to cycle between buttons programmatically, so I need to be able to change which button is listening for events when I move right/left or up/down. I have tried button.setSelection(true); inherited ...

9. How do I get a MouseListener to listen through stacked components?    stackoverflow.com

I've a JPanel with a grid of JLabels added. I'd like the JPanel to contain a MouseListener to listen for clicks, but the JLabels seem to be in the way and ...





10. listening to two keys simultaneously    coderanch.com

11. listening to two keys simultaneously    coderanch.com

14. Listening to the Mouse    coderanch.com

If I have a little application running that does not use Swing, how can I get it to read what my mouse is doing? For example : if I run a class that simply displays the number 1 using System.out.println(), it will write it to the DOS window. Now, say if I move my mouse while the DOS window is still ...

16. mouselistener... not always listening    coderanch.com





17. listening to events when Child node changes?    coderanch.com

I want to be able to trap events where in a node changes its position in the tree but within its parent only...for example i have a parent node with 5 child nodes.... and then i drag the 5th node so so that it becomes the 1st node.. how do i capture the event..What listener can i implement... I have already ...

18. Listeners - How to callback the object it is listening to    coderanch.com

Hi, Is there a way for a listener object (ex: myContainerListener) to know when it is being registered as a listener to a container object (in this case myContainer.addContainerListener(myContainerListener)) and get the reference of the object it is being registered to (i.e myContainerListener being able to call back methods on myContainer). Specifically, I am trying to create a windowsMenu object which ...

19. mouse listening    coderanch.com

20. problem to listen key board event    coderanch.com

22. Need help on mouse motion listening    coderanch.com

23. GUI Listener not Listening    java-forums.org

GUI Listener not Listening Hello everyone. I am attempting to create an NHL game tracker. For some reason my GUI listener isn't recognizing when I click a button. The only buttons that I have active thus far are Clear, Closed, and Standings. What might cause this? How can I fix it? Java Code: /** * Module: GameTracker.java * Author: ...

24. Mouse listening across layers    java-forums.org

Hi, I am having some troubles implementing mouse listening across layers. I currently have a panel with 2 subpanels as children laying on top of one another. The first panel has an image while the second has a shape. This image panel is clipped by a circle, and the shape panel adds a shape of a circle to give the clip ...