import javax.imageio.*;
import java.awt.image.*;
import java.awt.event.*;
import java.awt.*;
import java.security.NoSuchAlgorithmException;
import java.security.MessageDigest;
import java.lang.management.*;
import java.lang.reflect.*;
import java.net.*;
import java.io.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.*;
import java.util.regex.*;
import java.util.List;
import java.util.zip.*;
import java.util.*;


public class main {
  static Window[] windows;
  
  public static void main(String[] args) throws Exception {
    windows = Window.getWindows();
    print(windows.length +  " window(s) found.");
    //print(structure(windows));
    
    for (Window w : windows) {
      if (w instanceof JFrame) {
        JFrame f = (JFrame) ( w);
        print("Frame: " + quote(f.getTitle()) + ", position: " + f.getBounds() + ", visible: " + f.isVisible() + ", active: " + f.isActive());
      } else
        print("Window: " + w.getClass().getName() + " [" + w.getBounds() + "], visible: " + w.isVisible() + ", active: " + w.isActive());
    }
  }

static void print() {
  System.out.println();
}

static void print(Object o) {
  System.out.println(o);
}

static void print(long i) {
  System.out.println(i);
}

  public static String quote(String s) {
    if (s == null) return "null";
    return "\"" + s.replace("\\", "\\\\").replace("\"", "\\\"").replace("\r", "\\r").replace("\n", "\\n") + "\"";
  }
}