Bonjour,

J'ai un JTree assez grand :2000 entités.
J'utilise ce code pour l'ouvrir:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
if (ae.getActionCommand().equals(SecBabel.getString("sec.expand")))
    {
      trace_.debug("Clicks on expand button");
      SwingWorker sw = new SwingWorker() 
      {
    	  //amell
        public Object construct()
        {
          AciModalityManager.startModality();
 
          return null;
        }
 
        public void expandAll(JTree tree) 
        {
          TreeNode root = (TreeNode)tree.getModel().getRoot();
 
          // Traverse tree from root
          expandAll(tree, new TreePath(root));
        }
 
        private void expandAll(JTree tree, TreePath parent) 
        {
          // Traverse children
          TreeNode node = (TreeNode)parent.getLastPathComponent();
          if (node.getChildCount() >= 0) 
          {
            for (Enumeration e=node.children(); e.hasMoreElements(); ) 
            {
              TreeNode n = (TreeNode)e.nextElement();
              TreePath path = parent.pathByAddingChild(n);
              expandAll(tree, path);
            }
          }    
 
          tree.expandPath(parent);
        }
        public void finished()
        {
        	expandAll(fadViewTree_);
        	AciModalityManager.stopModality();
 
        }
 
	  };
      sw.start("");
Lors de l'éxécution de ce code, ma GUI devient toute grisée dés que je l'iconnifie.


Pourrais-je améliorer ce code pour éviter que la GUI soit grisée?


--Merci