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

Alt key causes form to redraw

I've come across a problem that I'm hoping one of you fine thinkers can overcome... For some reason, once I have loaded up my Windows Form, if the user presses the Alt key, the form redraws causing a flash. This only happens the first time, so any…
Gavin
  • 6,284
  • 5
  • 30
  • 38
4
votes
3 answers

Is there a way to only mark a specific JPanel region as opaque?

Basically I'm drawing a lot of transparent JPanels; profiling shows that most time is spent in Component.paint(). It would be possible to optimize this quite radically since in most cases the real non-opaque area per JPanel is quite small, for…
Philip Kamenarsky
  • 2,757
  • 2
  • 24
  • 30
4
votes
4 answers

Fluid images in Chrome: how to avoid repaint?

I'm working on a photography site with a lot of images and they have no fixed height and width as I want this site to be 100% fluid: how do you work around the ugly Chrome repaint of the images? (i.e. Images are first displayed at zero height and…
teolives
  • 83
  • 1
  • 5
4
votes
2 answers

Java - Repaint Not Working

So I am making a Text-Based RPG Applet in Java. I am using SWING panels, with text fields and buttons on it. I am programming it in Netbeans, and I am using the GUI editor. I have crafted the HTML page and it opens in the browser fine. When I click…
Jay
  • 143
  • 2
  • 11
4
votes
1 answer

Where did Firefox's "Paint Flashing Tool" go (in Firefox ~96)?

The "paint flashing" tool in Firefox seems to have vanished. Both the docs and this answer are outdated. I'm running Firefox 96.0.2 (and Firefox Developer Edition 97.0b7) on a mac, and neither of them appear to have this feature. It's not under…
4
votes
0 answers

Flutter customPainter doesn't repaint

shouldRepaint doesn't repaint when there is a change: import 'package:flutter/material.dart'; class MainCanvas extends CustomPainter{ static var penPointsToRender = []; @override void paint(Canvas canvas, Size size) { Paint paint =…
4
votes
1 answer

Redraw strings in CardLayout

I have made a game using CardLayout and have one JPanel for the leaderboard. In leaderboard, I read two files (one with names, one with times), sort them and draw the top 5 fastest times like this: private void setBoard(){ reset(); …
Faiq
  • 41
  • 7
4
votes
1 answer

Flashing animation getting interrupted by DoEvents

I have written some simple code in Excel VBA, to make a range "flash" a colour - this is achieved by carefully drawing a rectangle object over the range in question, and varying its transparency to make the box fade gradually. Here's the code (in…
Greedo
  • 4,967
  • 2
  • 30
  • 78
4
votes
2 answers

The right way to add Graphics to a JPanel in a music notation software

I have been working on a music notation software that I want to use to train my music students on sight-reading. I want to know whether I am taking the right approach or if there is a better way. I have managed to make the clef, notes and staff…
Josiah
  • 118
  • 10
4
votes
2 answers

JPanel doesn't repaint if repaint() is called within JFrame code

I have a class Forest and CellularJPanel, which extends JPanel and displays Forest. I wrote a primitive code to create JFrame, Forest, CellularJPanel and add CellularJPanel to the JFrame. Next is an infinite loop, which makes Forest update and…
Dariusz
  • 610
  • 1
  • 6
  • 14
4
votes
1 answer

How to change image in JPanel without using a new JFrame (Repaint() doesn't work! )

I've been working on a drinking game program for school. //this is the game //http://sotallytober.com/games/verbal/mexican/ Anyway, I painted a image in an JPanel using the following code (it's an class that extends JPanel) public class iconPanel…
Sytham
  • 824
  • 3
  • 11
  • 25
4
votes
2 answers

Scaling image through thread - JAVA

Let say I have an image. I put the image in a JPanel and add the JPanel inside a JFrame. The image moves from the bottom part of the frame to top of the frame while its size is also decreased using AffineTransform. The variable changes using…
noobprogrammer
  • 1,140
  • 7
  • 22
  • 35
4
votes
1 answer

dynamically change color of custom graphic

Problem: graphics aren't repainted until after methods are run. When button clicked two methods are called. Inside each method is code that is supposed to change the color of the graphic associated with this method (in the UI); when the method…
ross studtman
  • 936
  • 1
  • 8
  • 22
4
votes
2 answers

Label text doesn't get updated until the whole loop is completed

I have a Winform program that does some calculations when the user clicks on a button and then calls the picturebox paint event to draw a new BMP based on the results of the calculations. This works fine. Now I want to do this 100 times and every…
deutschZuid
  • 1,028
  • 2
  • 15
  • 33
4
votes
1 answer

Qt repaint paintEvent called but widget not updating

My paintEvent has access to a pointer whose value changes from time to time and what gets painted depends on these values. With basic debugging I'm sure that this function is being called but the window does not get updated. The new stuff only…
user1872099
  • 95
  • 2
  • 5