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

JPanel Repaint Not Clearing

I have a custom, abstract class 'Panel' which extends JPanel. There aren't many differences with the two when painting. I have a Panel and I'm simulating an animation by updating the x value of an image. I have two animations right now, one that…
aoi
  • 167
  • 1
  • 2
  • 11
3
votes
2 answers

How can I repaint a label while doing some processing, in Swing?

I'm new to Swing and I was trying to do this: On pressing a JButton, the program will start iterating over hundreds of items, taking 1 second to process each one, and after finishing each one he should update a label to show the number of items…
Tiago
  • 673
  • 1
  • 8
  • 24
3
votes
2 answers

Why doesn't my repaint work?

I'm stuck with a problem considering my Display class, which extends Canvas. A single thread is running within the very same class. In this thread, the repaint method is called. However, while the thread works fine, the paint method is never…
Tom S.
  • 243
  • 3
  • 9
3
votes
4 answers

How can I ensure correct drawing order in an OverlayLayout?

I am using a JPanel with an OverlayLayout to draw two unrelated components on top of each other. Specifically, I have a transparent component which contains my own line drawings, and beneath that, I am using a JMapViewer component, which displays…
double-m
  • 118
  • 8
3
votes
5 answers

Drawing problem in java

I am a new in java, and I need to implement a paint application, and I'm kinda stuck at the beggining, I managed to draw lines to a JPanel which I added to a JFrame, but each line drawn resets the entire drawing, and in the draw area remains only…
andrei
  • 55
  • 1
  • 6
3
votes
3 answers

Java graphics repaint problem

Having trouble with a simple paint pad in java. Issues with getting my clear button to repaint. The array is clearing but not repainting. Can anyone spot my problem or is there any different way of generating a clear button for this code. public…
mix2000
  • 45
  • 1
  • 1
  • 4
3
votes
2 answers

Faster to manipulate existing HTML or removing the HTML and then recreating it?

This project I am working on, I have a list of elements and convert them into a "graph" (not a true graph, but you can call it a psuedo one). I have my data set, i run a for loop over the data and then create a li element for each one, create and…
hellatan
  • 3,517
  • 2
  • 29
  • 37
3
votes
2 answers

Waiting for Swing's elements repaint completion

I want to be able to wait for Swing's repaint completion. Example: frame.repaint(); wait_for_repaint_to_finish(); //work I have something like this: SwingUtilities.invokeAndWait(new Runnable() { public void run() { try { …
pbp
  • 1,461
  • 17
  • 28
3
votes
2 answers

Multiple JFrame issue

The issue here is that after asking a user for the settings of a neural network through a settings JFrame, the new JFrame meant to visualise the network learning only seems to display something after the network is done looping through all the…
3
votes
1 answer

Can I be notified when a Item has finished repainting?

I'm making a snapshot (via a ShaderEffectSource with live: false) of an Item, but I'm sometimes (1 cases in 200) getting a blank snapshot. I'm making the snapshot based on a signal like this: Image { onStatusChanged: { if (status ==…
Stefan Monov
  • 11,332
  • 10
  • 63
  • 120
3
votes
4 answers

Java - Why does it not show an error dialog when the user gives in an unwanted input?

I am trying to color some ovals. The user types in for example color red (rood), and then the circles will be drawn and colored red, that works, but now I am trying to make it give an pop-up if the colors don't match the ones that are the user…
Zanic L3
  • 1,028
  • 1
  • 16
  • 28
3
votes
0 answers

When exactly are Qt Quick items repainted?

When exactly are Qt Quick items repainted? I.e. on which events? For example, if I have overlapping items A and B, and I change a property of A, will B get repainted as well? If not, how can it work? What if they are non-overlapping?
Stefan Monov
  • 11,332
  • 10
  • 63
  • 120
3
votes
2 answers

Java GUI repainting error?

This one's a tough one - I have a JFrame that generates JTextFields. When I go from generating 2 JTextFields to 12 JTextfields (for example), I see some error where there is an extra differently-sized JTextField at the end. It seems to be a repaint…
Devoted
  • 177,705
  • 43
  • 90
  • 110
3
votes
1 answer

Java - repaint() method is called once then it doesn't show anything

I've been trying to get a n-ary tree structure graphed so when I enter some node it shows up but it doesn't. It only draws the root then it "deletes" everything. Here's my code: public LinkedList nodes; public Tree tree; public TreeViewer()…
JMz
  • 71
  • 1
  • 9
3
votes
4 answers

c++ gdi animation not working

im trying to create ball animation using gdi but i can't get it working. i created a ball using this Graphics graphics(hdc); Pen pen(Color(255, 0, 0, 255)); graphics.DrawEllipse(&pen, sf , 0, 10, 10); i have while loop that loops and…
Ramilol
  • 3,394
  • 11
  • 52
  • 84