Questions tagged [repaint]

Repaint refers to issues relating to re-rendering or redrawing user interface screens or portions of those screens.

Repaint is the process of re-rendering or redrawing user interface screens or portions of those screens. A number of different paint techniques may be employed in 2-D or 3-D graphics.

1282 questions
100
votes
6 answers

What's the difference between reflow and repaint?

I'm a little unclear on the difference between reflow + repaint (if there's any difference at all) Seems like reflow might be shifting the position of various DOM elements, where repaint is just rendering a new object. E.g. reflow would occur when…
Jon Raasch
  • 3,703
  • 6
  • 30
  • 32
42
votes
4 answers

vs background-image (css) in performance

I am building a site that is using a scrolling plugin that basically animates the scrolling. I am quite concern about performance as if I insert some images in the site, it looks quite choppy when scrolling/animating. The main problem I can detect…
Alvaro
  • 9,247
  • 8
  • 49
  • 76
35
votes
3 answers

How is CSS applied by the browser, and are repaints affected by it?

Let's say we have an HTML page with a single stylesheet . How does the browser take the rules in this stylesheet and apply it to the HTML? I'm not asking about how to make it faster, I want to know how the rendering itself is handled. Does it…
Wesley Murch
  • 101,186
  • 37
  • 194
  • 228
33
votes
3 answers

How to remove all components from a JFrame in Java?

I'm writing a program where I have a JFrame and I want to remove all components from it, then add just one component to it and repaint the frame. What I have so far is something like the code below (called in an object that implements JFrame, where…
scaevity
  • 3,991
  • 13
  • 39
  • 54
26
votes
2 answers

Control and measure precisely how long an image is displayed

For a reaction time study (see also this question if you're interested) we want to control and measure the display time of images. We'd like to account for the time needed to repaint on different users' machines. Edit: Originally, I used only inline…
Ruben
  • 3,452
  • 31
  • 47
23
votes
3 answers

paint() and repaint() in Java

I've spent maybe the last two hours browsing and reading up on these methods and the Graphics class, and maybe I'm stupid, haha, but I'm just not understanding them. What are they for? I understand that they're supposed redraw or update components…
Daniel
  • 581
  • 1
  • 5
  • 11
20
votes
6 answers

How to improve painting performance of DataGridView?

(sorry for bad English) I have a big problem with performance of DataGridView when it re-paints. I'm using a DataGridView to show logs from an external application stream. Messages from the stream come in with a high frequency (less than 1 ms). If I…
Yuriy
  • 2,670
  • 6
  • 33
  • 48
19
votes
1 answer

In the dev tools timeline, what are the empty green rectangles?

In the Chrome dev tools timeline, what is the difference between the filled, green rectangles (which represent paint operations) and the empty, green rectangles (which apparently also represent something about paint operations...)?
Levi Lindsey
  • 1,049
  • 1
  • 10
  • 17
19
votes
1 answer

update() or repaint() fails to trigger paintEvent()

I have a QScrollArea fathering my awesome scrolling widget. I like to do updates on the contents on various occasions. For this I did an override of paintEvent(QPaintEvent *). Then everytime I want it to be done I call update() on the…
ypnos
  • 50,202
  • 14
  • 95
  • 141
18
votes
1 answer

Why does Chrome not need to repaint the entire layer on a change?

I am trying to understand, in practice, how the layout → paint → composite pipeline of Chrome works. During my testing, I got confused about Chrome's behavior in the following situation. (Codepen) var button =…
13
votes
3 answers

Is the Swing repaint() method still safe to use outside the EDT in Java 7+?

I know that it used to be considered safe to call repaint() and a few other selected methods from any thread even with Swing's threading model, however I was recently told in a comment that this is not so. Google found a lot of older discussion…
Tim B
  • 40,716
  • 16
  • 83
  • 128
12
votes
2 answers

Does AWT/Swing cancel painting operations if the monitor is off?

I am experiencing a problem with Swing that only occurs when the computer monitor is powered off, but my Swing application continues to run in the background. It seems that whenever the monitor is off, Swing/AWT cancels all painting operations,…
Joseph Trebbien
  • 309
  • 1
  • 3
  • 8
12
votes
3 answers

How can CSS have a significantly negative effect on page paint time in a specific area of a web page?

The Question: An invaluable article on the issue - mentioned by JackPattishallJr. How can CSS have a significantly negative affect on page paint time in a specific area of a web page? For example: I didn't know CSS took effect based on the user's…
user2700923
11
votes
1 answer

Why does ie apparently reflow DOM when encountering fbml elements when correctly using the fbml xmlns?

I have a page containing a number of facebook "Like" buttons, embedded using the inline fbml technique (as opposed to iframe). Simple enough. The page renders fine, everything works as expected. HOWEVER... Once I add the…
Bernos
  • 111
  • 6
11
votes
6 answers

Swing JPanel won't repaint

I have a simple object which extends JPanel, when the update() method is called on this object it it meant to add some labels to the panel and then repaint. However the labels do not show up after the update method is called, below is the code for…
Aly
  • 15,865
  • 47
  • 119
  • 191
1
2 3
85 86