What did i forgot [ public void mouseClicked (MouseEvent e) ]

From: Konrad Den Ende (chamsterkonrad_at_bigfoot.com)
Date: 11/23/03


Date: Sun, 23 Nov 2003 16:34:03 +0100

It's been a while since my last encounter with Swing so it
must be something i simply forgot.

I extend a JPanel and implement MouseListener. All the
methods have empty bodies except for:
public void mouseClicked (MouseEvent e)
    {JOptionPane.showMessageDialog (null, "");}

However, nothing comes up when i click within the JPanel...

One guess is that i need to add my code to the frame that the
JPanel is hold by but that's kind of not what i'm aiming at. I
need to keep the clicking-events within the panel.

What do i forgot?

-- 
Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places; 
their souls be chased by demons in Gehenna from one room to 
another for all eternity and more.
Sleep - thing used by ineffective people
            as a substitute for coffee
Ambition - a poor excuse for not having
                 enough sence to be lazy
---------------------------------------------------


Relevant Pages

  • Re: Static listeners?
    ... abstract public class VisualStimulus extends JPanel ... mvc wird von swing nicht ... Und ein JPanel ist für mich kein Controller, ... JCheckBox lässt sich doch nicht alleine auf den View reduzieren...! ...
    (de.comp.lang.java)
  • Re: Use JFrame and a canvas
    ... Are you sure you really want a java.awt.Canvas in the midst of your Swing ... It is much more common to see people draw on a JPanel, ... If you mix AWT controls with Swing controls in the same GUI you get a lot of ... ugliness due to interactions between the heavyweight AWT controls and the ...
    (comp.lang.java.programmer)
  • Re: Static listeners?
    ... abstract public class VisualStimulus extends JPanel ... Controller. ... mvc wird von swing nicht ...
    (de.comp.lang.java)
  • Re: How to make a custom modal dialog
    ... it *is* a class deriving from JPanel not from Panel. ... As I said reading web-browsable documentation, ... with the IDE as well and some articles, ... only I want to stick to Swing rather than IBMs SWT for reasons ...
    (comp.lang.java.gui)
  • Re: Difficulty with swings
    ... Why you are both so quick to rush in with Swing based suggestions ... * In any case a JPanel is more than you need for a rendering surface.. ... I suspect the OP would be better served by reading the Graphics tutorials, ... suggestions for further reading are.. ...
    (comp.lang.java.gui)