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
10
votes
4 answers

repaint() in Java

Possible Duplicate: Java GUI repaint() problem? I write a Java code, but I have a trouble with GUI problem. When I add a component into JFrame object, then I call repaint() method in order to update the GUI but it doesn't work. But when I…
user1141672
10
votes
2 answers

Restoring WinForm with textbox containing large amount of data

I have created a form in C# (VS2010) which contain (among other) a textbox control. The textbox may contain large amount of data at some point (~3 million chars). When scrolling or moving the form around no problems are encountered, but when the…
zulfin
  • 111
  • 4
9
votes
2 answers

Why does my custom Swing component repaint faster when I move the mouse? (Java)

I am trying to make a 2D game with Java and Swing, and the window refreshes too slow. But if I move the mouse or press keys, the window refreshes as fast as it should! Here is a GIF showing how the window refreshes quickly only when I move the…
user12071097
9
votes
1 answer

Why is it recommend to nest setTimeout in requestAnimationFrame when scheduling something after a repaint?

In the mozilla docs on performance best practices for front-end engineers it's recommended to combine setTimeout with requestAnimationFrame to run something immediately after a repaint: requestAnimationFrame(() => { setTimeout(() => { // This…
user5918874
9
votes
2 answers

CSS by data-attribute will not refresh/repaint

In a HTML5/JS application we have a view with some styles depending on the data-attribute of elements: like
  • or
  • CSS li[data-level^="1"] { /* some styles */ } This seems to work just fine…
    gherkins
    • 14,603
    • 6
    • 44
    • 70
    8
    votes
    2 answers

    Swing: Can't get JButton to update - repaint() not working

    I'm using Swing for the first time to create a simple GUI. It consists of a JFrame upon which I have placed a single JButton which, when clicked, calls some other code which takes approx. 3 seconds to return. Just before the call to this code, in…
    William
    • 13,332
    • 13
    • 60
    • 73
    8
    votes
    1 answer

    How to update Android Views upon modifications?

    I have some methods in my View that modify some of the shapes that are drawn when called. In Java in order to make sure the component is updated I would call repaint(). Is there something that will make sure my view is updated correctly? I had read…
    StartingGroovy
    • 2,802
    • 9
    • 47
    • 66
    8
    votes
    1 answer

    cssText or individual stylename?

    When we are applying a lot of style changes using JavaScript to a single element, phpied & Writing Efficient JavaScript (slide 87) suggests: instead of applying styles one by one using style.stylename, apply everything in one go using cssText or…
    Anish
    • 1,164
    • 4
    • 15
    • 27
    8
    votes
    2 answers

    IE10 JavaScript cannot repaint window while computer is locked?

    The Problem Occurs on IE10. (IE8 works fine.) I've written some JavaScript code that, after 20 minutes of inactivity, redirects the browser to another URL to indicate the user was logged out. Normally this works fine. However I've noticed a…
    8
    votes
    2 answers

    paintComponent draws other components on top of my drawing

    I'm trying to build a simple paint tool. The mouseDrag events creates a new ellipse and causes my JPanel to repaint(). This works fine so far. However, if I press any button (or any other UI component) before firing the mouseDrag event for the first…
    Reini
    • 1,233
    • 3
    • 19
    • 34
    8
    votes
    3 answers

    Java Transparency rendering error

    I am currently developing a kiosk style Java program to display weather, time, forecast etc. Here is a shot of what the program should look like (screenshot taken before the time updated) The various sections are created as JPanels with the…
    Peaches491
    • 1,239
    • 15
    • 27
    7
    votes
    1 answer

    How do I invoke an immediate update to a Java GUI? (conflict with Thread.sleep())

    I am making the game Memory, when you pick two cards and if they match you get to keep them, otherwise you turn them back. If you then remember cards you have already chosen, you can venture a better guess on the next two cards. The problem I have…
    Eric Thoma
    • 5,905
    • 6
    • 30
    • 40
    7
    votes
    3 answers

    Scrolled composite with slow to repaint content looks ugly

    I am implementing a Gantt component for SWT and this takes a bit to repaint (like, 200 ms for the whole visible part of the diagram). Now, when I scroll, I only repaint what is needed regarding the clipping rectangle. This makes the application look…
    Daniel
    • 27,718
    • 20
    • 89
    • 133
    7
    votes
    3 answers

    Repaint issues when switching between programs

    MyApp (.NET c#) is triggered by OtherApp (c++). When triggered my app takes over the whole screen and gives the user two options. One option quits MyApp and returns to the OtherApp home screen. The 2nd option exits the intial screen and shows…
    Scottf007
    • 509
    • 3
    • 5
    • 15
    7
    votes
    2 answers

    JFrame repaint() issues - Java

    I want to be able to draw using Java's paint() on a JFrame. When I click the JFrame (anywhere for now) I want the JFrame to be repainted with the co-ordinates of the click - similar to this Java applet…
    Mr Tickle
    • 71
    • 1
    • 1
    • 2
    1
    2
    3
    85 86