repaint

JTree updates in realtime?

I'm looking for a threaded solution to updating my JTree every second. Basically, I'm... Importing an external file Creating an Enumeration off of that Building the tree off the enumeration The external file can change at random, and the data in the tree needs to represent this change in a somewhat reasonable time manner. How would ...

Repaint frame when resized?

How would I force a Frame to repaint() immediately after it is maximized, or resized? I can't find what method is called when that specific operation takes place. I have a bunch of graphics that are written with Graphic objects in paint and their orientation depends on the real time feedback from getWidth() and getHeight() but paint isn...

sIFR.useStyleCheck weirdness in Safari 4 and Opera

So, I'm using sIFR (version 3, revision 436) to replace elements in my navigation, and everything is beautiful. But when I turn on sIFR.useStyleCheck to detect the CSS load, everything goes wonky in Safari 4. By wonky, I mean that it seems like the inserted dummy div lingers with its 42px left margin, and it throws off the sIFR'd text ...

java swing repaint()

(second question in a few hours) Kay so I'm making a chess variant in java, I have my console program working how I want it but now I'm trying to convert it to a swing GUI while STILL keeping the console things intact. So up to now I have my array of squares with pieces in them for the console, and a 2-dimensional array of JPanels with ...

Why does repaint(long) repaint immediately?

According to the Javadoc, JComponent.repaint(long) is supposed to schedule a repaint() sometime in the future. When I try using it it always triggers an immediate repaint. What am I doing wrong? import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ActionEvent;...

DataGridView lags for a second with large data updates

I have a DataGridView with about 400 rows and 10 columns. When the user first displays this table, it receives all of the data from the server and populates the table. The DGV uses a DataTable as it's data source, and when updating the DataTable I use row.BeginEdit/EndEdit and acceptChanges, but when the View itself is updated it lags ...

Using Java's JComponent repaint()

Hi there, I'm writing a simple Game of Life program in Java and am having a bit of trouble getting it to animate. I've got a JComponent class LifeDraw, which displays a grid of pixels, with the following paint method: protected void paintComponent(Graphics g) { super.paintComponent(g); for (int y = 0; y < lGrid.getHeight(); y+...

Swing JPanel wont repaint

Hi, I have a simple object which extends JPanel, when the update() method is called on this object it it meant to add some labels to the panel and then repaint. However the labels do not show up after the update method is called, below is the code for update: public void update(){ GridBagConstraints constraints = new GridBagCons...

How to CLONE a JPanel to Paint the same in both, in the original and in the clone panel ?

Hi all! Anybody know how can I clone a JPanel to Paint the same thing in both, in the original panel and the clone panel, like if the objects were a mirror, but using CLONE, so I can REPAINT() one, and the other will do the same automatically. My code only paints the original JPanel if I move the mouse in the original or in the clone pa...

DataGridview repaints very slowly

I'm using datagridview in windows application developed in C# VS2005 .net 2.0. Datagridview is provided a list of business objects. It take annoying delay of 2-3 seconds before starting displaying the rows in datagridview in falling-curtain fashion. When I switch back to my application from any other window it start repaint process in t...

QT4: update() or repaint() fails to trigger paintEvent()

I have a QScrollArea fathering my awesome scrolling widget. I like to do updates on the contents on various occasions. For this I did an override of paintEvent(QPaintEvent *). Then everytime I want it to be done I call update() on the widget. Problem: paintEvent() is never called by this! What I tried in troubleshooting so far: Use ...

repaint problem with JPanel inside a JPanel

I'm drawing shapes inside this JPanel, which is also inside another main JPanel. At repaint() it only draws the shapes for one millisecond and then they disappear. They don't stay painted, why? my paintComponent method is something like this @Override public void paintComponent(Graphics g) { super.paintComponent(g); for (in...

Delphi. Prevent controls repainting for a time.

For example I disable runtime two buttons. After I disabled first button it bacame gray, the second - it also became gray. But I do not know how to make the repainting simultaneous! I need something like that: freeze the Form (disable repainting) disable first button disable second button Enable Form repainting If someone knows how t...

JMenuBar dropping down to a "custom" JPanel and "erased"

The JMenuItems of JMenuBar drops down to a JPanel added to the JFrame, but the JPanel erases the JMenuItems. Do I supposed to pause the re-drawing of the JPanel? I'm using getGraphics() on the JPanel for drawing an image, this method is called from a thread with (for example) 200 ms delay. edit: It's a (very simple) game inside the JPan...

Java repaint is slow under certain conditions.

I'm doing a simple grid which each square is highlighted by the cursor: They are a couple of JPanels, mapgrid and overlay inside a JLayeredPane, with mapgrid on the bottom. Mapgrid just draws on initialization the grid, its paint metodh is: public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Gr...

What's the difference between reflow and repaint?

I'm a little unclear on the difference between reflow + repaint (if there's any difference at all) Seems like reflow might be shifting the position of various DOM elements, where repaint is just rendering a new object. E.g. reflow would occur when removing an element and repaint would occur when changing its color. Is this true? ...

How to report progress of a JavaScript function?

I have a JavaScript function which is quite long and performs a number of tasks, I would like to report progress to the user by updating the contents of a SPAN element with a message as I go. I tried adding document.getElementById('spnProgress').innerText = ... statements throughout the function code. However, whilst the function is ex...

How to repaint another Qt class

Hi all, I'm a new bit in Qt... I have a Qt GUI application (written by me), let's call it QtAPP.exe When QtAPP.exe running, I will use a QThread and QProcess to execute some external file, such as player.exe (written in native C). Here's my question: In QtAPP.exe, there are 2 classes, 1. QMainWindow - Core of QtAPP.exe 2. QThread - A t...

Swing button repaint issue

Hello, I'm new to java and I have to get a school project done by Sunday and got a problem. Here's the code: private abstract class GamePanel { JPanel panel = null; } private class PutPanel extends GamePanel { JButton putShip1 = new JButton(""); JButton putShip2 = new JButton(""); JButton putShip3 = new JButton("");...

How do I repaint a form after it was restored from a minimized state?

I have a form in which i paint a waveform on a button click that is as soon as i click button, the waveform displays. Now when i minimize the form and maximize it again, the waveform disappears.How to repaint it? I have seen people using paint event but i dont know how to use it after/inside the button click event. Please help. ...