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
4
votes
1 answer

How to update a QPixmap in a QGraphicsView with PyQt

I am trying to paint on a QPixmap inside a QGraphicsView. The painting works fine, but the QGraphicsView doesn't update it. Here is some working code: #!/usr/bin/env python from PyQt4 import QtCore from PyQt4 import QtGui class…
pops
  • 43
  • 1
  • 4
4
votes
2 answers

Disable winforms refresh

Every time I change the enable disable property of the controls on my winform it repaints the whole form. I want to avoid the redundant repaints by only repainting when i have updated all of the controls. Is this possible?
SA.
  • 435
  • 1
  • 5
  • 10
3
votes
1 answer

Java repaint not displaying component correctly

im developing an GUI Application, using JSWing, i load XML file, then deserialize it, then i add all created object to the JPanel. However, until i move the window, or click on the panel, this is how they looks like After i move the window, they…
Anton Giertli
  • 896
  • 2
  • 10
  • 29
3
votes
3 answers

Trigger event only after repaint in Java Swing?

I am making a simple board game in java, where I want to animate a dice roll. So I flash pictures of a dice like this: public Timer roll_dice = new Timer(50, this); ... public void actionPerformed(ActionEvent evt) { if(roll_dice.getDelay() >…
wfbarksdale
  • 7,498
  • 15
  • 65
  • 88
3
votes
1 answer

Java - repaint(x, y, w, h) doesn't call paintComponent? (with SSCCE)

I asked this before, but only theoretically, without an SSCCE. Now, I've created one, and the problem persists. I'd like to know why paintComponent is not called on repaint(x, y, w, h), but is called on repaint(). Two classes: SANDBOX import…
Ben
  • 54,723
  • 49
  • 178
  • 224
3
votes
2 answers

how to use jpanel with paint (or repaint)

I'm a newbie to the paint/graphics and wonder how to add a JPanel to my code in such way that the entire graphics will be on a JPanel and not on the JFrame. In other words, I'm trying to create a GUI that will allow me to do this: on the RIGHT side…
adhg
  • 10,437
  • 12
  • 58
  • 94
3
votes
2 answers

Repaint leaves trail

I know that this isn't the first time that this question has been asked, but the responses haven't helped me much, so I am helping I am finally going to get my answer I have made this little game where I have made a car drive around a track (using…
Stormel
  • 143
  • 3
  • 9
3
votes
3 answers

My JFrame Flickers

I'm trying to make a simple java game -- driving a car through a track. I am conditioned by my teacher to use rectangles and stuff like that . My problem is when I use the method repaint() that my frame flickers. I have tried to put the repaint…
Stormel
  • 143
  • 3
  • 9
3
votes
3 answers

Java Swing - flickering Canvas graphics

I have to write a simple Java app which can load pictures, show it in a GUI form, allow the user to apply some transformation, and show the transformed picture. My solution is working fine, but the UI is flickering a bit, because the repaint method…
asdfghjkl
  • 91
  • 2
  • 8
3
votes
6 answers

Delphi - TEdit Labels are not displaying (Windows 7/Vista only)

I we got few TEdit forms inserted on another form, but their labels are not displaying until I change size of the window. This happens just on Windows Vista / Windows 7. Windows XP has everything labeled correctly. Ive already tested repaint /…
cyberMythius
  • 39
  • 1
  • 3
3
votes
5 answers

Repaint JPanel only after window resize is finished

I have a JPanel on which I've painted four rectangles. The color for each of these rectangles is selected at random. The colors should change only when the user clicks on a particular rectangle. The problem is, while a user is resizing the window,…
Gautam
  • 4,006
  • 3
  • 32
  • 37
3
votes
1 answer

Can I tell the JPanel paintComponent(Graphics g) function to only repaint the object I'm editing?

I'm writing an app in java using a JPanel to draw maps, I've used Landmass as a class, and the workspace (extends JPanel) uses multiple landmasses to represent each continent/island. currently, the paintComponent runs a for loop over every Landmass…
Callum Rae
  • 53
  • 4
3
votes
1 answer

How to display JLabel text for 1 second?

I am wanting my error messages to display in a JLabel temporarily, then set the text back to "". But instead it looks like it just skips over setting the message. I've stepped through the code and found it's setting the text, but it isn't displaying…
user967870
  • 31
  • 3
3
votes
4 answers

Painting in Swing, blinking issue

I have the following problem in swing. I'm implementing basic drawing operations (lines, shapes). When I'm moving mouse with pressed left button, I need to repaint current shape. So I clear the screen and repaint already drawn shapes and currently…
Timofei Davydik
  • 7,244
  • 7
  • 33
  • 59
3
votes
3 answers

Repainting in Swing JComponent after an interval

I have been assigned a project where I have to make an analog clock using the GregorianCalendar object in java. First, we were told to get the clock working, so that it shows the proper time on each run. Then we were told to make the clock redraw…
Tom
  • 911
  • 4
  • 10
  • 21