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

Repaint() method calling in another class

I have a problem with repaint() method in my Java code. I want to call it in another class but I can't, something doesn't work at all. I've searched on forums, but nothing was able to help me out. My Main class: public class Main { public static…
McDaniel
  • 83
  • 5
6
votes
2 answers

Android custom view not repainting, though onDraw is being called

I have custom view called ArrowView. When this view is part of a layout which is part of an ArrayAdapter everything is fine. (It is repainted as the underlying data changes.) When I use that same layout as part of another Adapter the ArrowView…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
6
votes
3 answers

Speeding Up Slow, CPU-Intensive Scrolling in WinForms

How can I speed up the scrolling of UserControls in a WinForms app.? My main form has trouble scrolling quickly on slow machines--painting for each of the small scroll increments is CPU intensive. My form has roughly fifty UserControls (with…
S B
  • 61
  • 1
  • 2
6
votes
1 answer

Android RatingBar painting itself wrong

I need to force a repaint of the RatingBar control. After many problems with the ratingbar and styles, I managed to get almost everything working. I use it in a listview item. Due to how it works, one has to "fight" a little with its look and…
Tom
  • 3,587
  • 9
  • 69
  • 124
6
votes
1 answer

Reflow / repaint detection: Possible today? Possible in the future?

I'd like to know if there's a reliable way on modern web browsers to detect document reflows and/or repaints, or if there's any pressing interest for such a thing that might put it in a W3 spec. I would also like to know how it can be accomplished…
Gui Prá
  • 5,559
  • 4
  • 34
  • 59
6
votes
2 answers

Java Swing screen artifacts

I have a Swing application with some sort of repaint issue. When a screen (JFrame) is closed, artifacts from that screen are sometimes painted over other screens. It is completely unreproducible on the 100+ developer machines at our office and…
Jason
  • 321
  • 2
  • 16
6
votes
3 answers

repaint() in Java doesn't "re-paint" immediately?

I have a code like that: // In MyPanel.java public void paintComponent(Graphics g) { super.paintComponent(g); // Draw something mypanel_count++; } // In Test.java public void testLargeData() { while (notDone) { …
Bood Carley
  • 538
  • 1
  • 4
  • 15
6
votes
1 answer

Program not accessing method paintComponent() of extended JPanel class

This is the JFrame package client.connection; import java.awt.Dimension; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import javax.swing.JFrame; class DrawFrameRemoteControl extends JFrame { private…
Jisan Mahmud
  • 201
  • 1
  • 4
  • 11
6
votes
1 answer

In swing-java, where does the Graphics instance come from?

When an update request is delivered to swing (either system triggered e.g. because of a resize or a block by another window, or app-triggered e.g. by a call to repaint() method), how is this request actually handled? What procedure takes place in…
Untitled
  • 781
  • 1
  • 6
  • 24
5
votes
3 answers

Java repaint not working correctly

i use the java repaint method , it repaints, but the update is only seen when I either click on the canvas or resize the panel. How can I fix this ? What causes it?
Ben
5
votes
2 answers

Paint in a part of JPanel without repaint the rest

I'm trying to make a Mastermind in Java. The code isn't really difficult, but I want to have a very good interface. I have a JPanel which take all my JFrame, and I paint this JPanel with surchargind repaint() method: //method to draw elements on…
bbusseuil
  • 261
  • 1
  • 4
  • 14
5
votes
3 answers

Java Graphics repaint behavior

I have been searching for a reason for this behavior in my code for quite some time now. I do not want to dive too deeply into the Swing API to figure why this occurs. I would appreciate any information regarding what causes this problem. This is a…
5
votes
2 answers

.setVisible(true) immediate repaint

In a short method, I hide a JFrame using setVisible(false). Then I take a screenshot and restore the JFrame with setVisible(true). After made visible again, the window is supposed to show a different picture than before (lets say a part of that…
Zymox
  • 109
  • 4
  • 8
5
votes
3 answers

Change Panel size on button click

I have the following code: package in.res.num.tapb.ui; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import…
Tapas Bose
  • 28,796
  • 74
  • 215
  • 331
5
votes
4 answers

java paint problem - black components

I am having a weird java problem - For some reason quite often when I open a dialog it becomes black. When I force a repaint (for example, draging it out and into the screen again) it draws itself normaly again. The problem seems to occur only on my…
Ran
  • 657
  • 2
  • 13
  • 29