• Post Reply Bookmark Topic Watch Topic
  • New Topic

repainting in swing

 
tim arnold
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I extend JEditorPane like so:
import javax.swing.*;
import java.awt.*;

public class TestPane extends JEditorPane
{
static int PAINT_COUNTER = 0;

public void paint(java.awt.Graphics g){
super.paint(g);
System.out.println("paint "+(++PAINT_COUNTER));
}
}
paint is always being called. Can someone please tell me what is up with this and maybe how to stop it???
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's getting repainted continually because of the blinking caret. You can turn it off if you want with :
 
tim arnold
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!