graphical updates stil don't work ;(

gskc [2002-03-26 04:42:43]
graphical updates stil don't work ;(
Filename
demo/NPortal.java
diff --git a/demo/NPortal.java b/demo/NPortal.java
index 70bbd21..619ff4c 100644
--- a/demo/NPortal.java
+++ b/demo/NPortal.java
@@ -46,6 +46,7 @@ import java.awt.Color;
 import java.awt.Component;

 import java.util.Map;
+import java.util.Date;
 import java.util.TreeMap;

 import javax.swing.JList;
@@ -105,8 +106,19 @@ public final class NPortal {
                                          initTaskPanel(),
                                          initReplPanel()) {

+                      int lastLoc;
+                      long lastSet = new Date().getTime();
+                      long currTime;
                       public void paint(Graphics g) {
-                        setDividerLocation(0.5);
+                        currTime = new Date().getTime();
+                        if (Math.abs(getDividerLocation() - lastLoc) >= 0.05) {
+                          setDividerLocation(0.5);
+                          lastLoc = getDividerLocation();
+                          lastSet = currTime;
+                        } else if (currTime - lastSet >= 200) {
+                          setDividerLocation(0.5);
+                          lastSet = currTime;
+                        }
                         super.paint(g);
                       }
                     },