public override void DisplayVisualTree()
        {
            if (!JavaAccNativeMethods._IsWindowsAccessBridgeAvailable)
            {
                JavaAccNativeMethods.LoadJavaAccessBridge();
                JavaAccNativeMethods.Windows_run();
                Trace.WriteLine("Initializing the java dda instance..");
                JavaAccHelperMethods.InitializeJavaAccessBridge(true);
                System.Windows.Forms.Application.DoEvents();
                System.Windows.Forms.Application.DoEvents();
                System.Windows.Forms.Application.DoEvents();
                System.Windows.Forms.Application.DoEvents();
                System.Windows.Forms.Application.DoEvents();
            }
            int vmId = 0;

            System.IntPtr accFromWindow = JavaAccHelperMethods.GetAccFromWindow(rootWindow, out vmId);
            jtvm = new JavaTreeViewModel(new JavaWindow(null, accFromWindow, vmId));
            if (w != null)
            {
                w.Closing -= W_Closing;
                avv        = null;
                w          = null;
            }
            avv = new ApplicationVisualViewer(ApplicationName);
            avv.LoadTree(jtvm);
            w          = new Window();
            w.Closing += W_Closing;
            w.Content  = avv;
            w.Show();
        }
 private void W_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     w   = null;
     avv = null;
 }