Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why is JTable scrolling taking so much memory?
  2. @Override
  3. public void run() {
  4.         while (true) {
  5.             jScrollPane1.repaint();
  6.             jScrollPane2.repaint();
  7.             try {
  8.                 this.sleep(10);
  9.             } catch (InterruptedException ex) {
  10.                 ex.printStackTrace();
  11.             }
  12.         }
  13.     }
  14.        
  15. @Override
  16. public void run() {
  17.     while (true) {
  18.         aLabel.setText("Memory consumption: " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory());
  19.         try {
  20.             this.sleep(200);
  21.         } catch (InterruptedException ex) {
  22.             ex.printStackTrace();
  23.         }
  24.     }
  25. }