repaint

IE10 JavaScript cannot repaint window while computer is locked?

大兔子大兔子 提交于 2019-12-10 03:10:47
问题 The Problem Occurs on IE10. (IE8 works fine.) I've written some JavaScript code that, after 20 minutes of inactivity, redirects the browser to another URL to indicate the user was logged out. Normally this works fine. However I've noticed a strange scenario.... if the user's Windows computer was locked during this timeout then it appears as though nothing has happened. However, when I look at the browser's URL bar, I can clearly see that the URL has already been updated to the auto-logout

cssText or individual stylename?

社会主义新天地 提交于 2019-12-08 16:49:03
问题 When we are applying a lot of style changes using JavaScript to a single element, phpied & Writing Efficient JavaScript (slide 87) suggests: instead of applying styles one by one using style.stylename, apply everything in one go using cssText or changing classname as it'll reduce reflows/repaints Which is better when there's only a single style change? document.getElementById('myid').style.cssText += ";color:#999;"; OR document.getElementById('myid').style.color = "#999"; jsperf.com/csstext

Delphi 6 : breakpoint triggered on non-VCL thread stops main thread repaints

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 04:08:55
问题 I have a multi-threaded Delphi 6 Pro application that I am currently working on heavily. If I set a breakpoint on any code that runs in the context of the Main thread (VCL thread) I don't have any problems. However, if a breakpoint is triggered on any code in one of my other threads, after I continue the application from the breakpoint, all repaints to the VCL components on the main thread (including the main form) don't happen anymore. The application isn't dead because other background code

Java Canvas repaint() is flickering

佐手、 提交于 2019-12-08 03:51:06
问题 So I finally got a Canvas to work the way I want it but it flickers constantly, repaint() is run 20 times a second and the flicking does lessen when I make it run 10 times a second. package pd.data; import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JPanel; import pd.areas.MainMenu; @SuppressWarnings("serial") public class Main extends JFrame implements Runnable { private JPanel contentPane = new JPanel(); private Thread gameThread = new Thread(this); public boolean

JavaFX 2: Tables: Update display after having updated data

跟風遠走 提交于 2019-12-07 18:43:52
问题 This is all I need to finish answering my last question. If you look at my last question, you will see my class, containing four fields, corresponding to the four columns of my table public static class ContactOptions { private final StringProperty one; private final StringProperty two; private final StringProperty three; private final StringProperty four; ContactOptions(String col1, String col2, String col3, String col4) { this.one = new StringProperty(col1); this.two = new StringProperty

Why doesn't my repaint work?

强颜欢笑 提交于 2019-12-07 16:06:46
问题 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 called! Here's my code (I left out everything unrelated): package display; public final class Display extends Canvas implements Runnable { private static final long serialVersionUID = 1L; private Frame frame; private GraphicsEnvironment ge; private

Using Java's JComponent repaint()

大憨熊 提交于 2019-12-07 12:20:12
问题 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 called 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++) { for (int x = 0; x < lGrid.getWidth(); x++) { if (lGrid.getCell(x,y) == 1) { g.setColor(Color.red); g.fillRect(x * lGrid.getSqSize(), y * lGrid.getSqSize(), lGrid

Why does my custom Swing component repaint faster when I move the mouse? (Java)

£可爱£侵袭症+ 提交于 2019-12-07 03:01:34
问题 I am trying to make a 2D game with Java and Swing, and the window refreshes too slow. But if I move the mouse or press keys, the window refreshes as fast as it should! Here is a GIF showing how the window refreshes quickly only when I move the mouse. Why does the window refresh slowly like that? Why does the mouse and keyboard affect its refresh rate? How, if possible, do I make it refresh quickly all the time? Background Info I use a javax.swing.Timer to update the game state every 1/25

How to update Android Views upon modifications?

牧云@^-^@ 提交于 2019-12-07 00:12:19
问题 I have some methods in my View that modify some of the shapes that are drawn when called. In Java in order to make sure the component is updated I would call repaint() . Is there something that will make sure my view is updated correctly? I had read somewhere that calling invalidate() in the onDraw() method would keep things up to date and therefore I wouldn't need to have something like repaint() in my methods that modify that shapes that are drawn. Is this correct, or is there something

How to clear/ reset a JFrame

旧城冷巷雨未停 提交于 2019-12-06 05:26:50
Me and my friend have decided to work on a card game which cycles between 3 screens ( Player1HandScreen, Player2HandScreen and FightScreen ). Once Player1 has chosen their card from Player1HandScreen , Player1HandScreen leads to Player2HandScreen where Player2 does the same. then Player2HandScreen leads to FightScreen where the two cards are compared and one player is declared the winner of that round. The problem we are having is that once the round ends we want to clear Player1HandScreen as well as the Player2HandScreen once refreshing our parameters we are having trouble updating the GUI