示例#1
0
  @Override
  public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
    try {
      throw new Exception();
    } catch (Exception exc) {
      StringBuffer sb = new StringBuffer();
      StackTraceElement[] stack = exc.getStackTrace();
      int count = 0;
      for (StackTraceElement stackEntry : stack) {
        if (count++ > 8) break;
        sb.append("\t");
        sb.append(stackEntry.getClassName() + ".");
        sb.append(stackEntry.getMethodName() + " [");
        sb.append(stackEntry.getLineNumber() + "]");
        sb.append("\n");
      }
      System.out.println("**** Repaint stack ****");
      System.out.println(sb.toString());
    }

    super.addDirtyRegion(c, x, y, w, h);
  }
 protected boolean isLiableToEDTRule(StackTraceElement element) throws Exception {
   return Component.class.isAssignableFrom(Class.forName(element.getClassName()));
 }