Not repaint panel when scene moved

hi, i have next components. JPanel, which contains JScrollPane with JLabel on it. Right now, when mouse moves over JPanel, all of those components (or at least JLabel) are repainted. How i can forbid repaint method on mouse moved event?
[250 byte] By [EnterSBa] at [2007-10-3 2:21:45]
# 1

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class Repaint extends MouseMotionAdapter

{

JLabel report = new JLabel(" ", JLabel.CENTER);

public static void main(String[] args)

{

Repaint test = new Repaint();

TalkingLabel label = new TalkingLabel("label");

label.addMouseMotionListener(test);

JFrame f = new JFrame();

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.getContentPane().add(new JScrollPane(label));

f.getContentPane().add(test.report, "South");

f.setSize(400,400);

f.setLocation(200,200);

f.setVisible(true);

}

public void mouseMoved(MouseEvent e)

{

// did you do something here to cause repainting?

report.setText("x = " + e.getX() + " y = " + e.getY());

}

}

class TalkingLabel extends JLabel

{

public TalkingLabel(String text)

{

super(text, CENTER);

setFont(getFont().deriveFont(18f));

setBackground(Color.pink);

}

protected void paintComponent(Graphics g)

{

((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,

RenderingHints.VALUE_ANTIALIAS_ON);

super.paintComponent(g);

System.out.println("talking label is repainting itself");

}

}

74philipa at 2007-7-14 19:20:42 > top of Java-index,Security,Cryptography...