How to select node in JTree without firing event?

I have got standard situation. JTree in the left panel, and several edit boxes in right panel. Certainly, I have TreeSelectionListener, which on every tree node selection shows corresponding model values in edit boxes.
I'd like to implement next logic:
1. Something was changed in any edit box in right panel. Model has been changed.
2. User clicks on different node in tree.
3. Dialog "Message was not saved. Save?" with Yes/No/Cancel buttons are shown.
Yes/No buttons are easy to handle.
Question is about Cancel. I'd like on Cancel button left all edit boxes in their present state (do not restore values from saved model) and select back node, which wasn't saved.
Problem is next. If I select node by setSelectionPath or smth like that, but... JTree fires event and my listener receives onTreeItemSelected back, which checks that node wasn't saved and ......
Who does have any idea, or have done similar tasks? How can I select node and do not allow tree fire event this time?
Thanks in advance.

First, as soon as the model changes (when editing any
combo box) some flag will be set. Now the logic which
updates the combo boxes will do it only on a change of
the current node and (this is new) if the flag wasn't
set. You should have some flag anyway because somehow
you must determine when to show the dialog, shouldn't
you?Yes, I have got this logic implemented. But it's only the half :)
I know exactly when my model has been changed, but if it was changed, i'd like to ask user what to do next - svae/loose changes/cancel
And on cancel i'd like to select last edited tree node and do not get event from tree at that moment.
>
Second way, prevent selecting a new node if that flag
has been set. You could do this by subclassing
DefaultTreeSelectionModel and overriding some methods
(setSelectionPath() et al).Ok. I'll investigate this.
>
MichaelThanks.

Similar Messages

  • Setting custom color for selected node in JTree?

    Hi,
    i want to set my own color for selected node in JTree. i don't want to set for all the nodes...how to set Color for Selected node using TreeCellRender class?
    Thanks
    Mani

    I assume you are not setting a custom tree cell renderer...
    javax.swing.JTree theTree = ...;
    java.awt.Color newBGColor = ...;
    ((javax.swing.tree.DefaultTreeCellRenderer)theTree.getCellRenderer())
        .setBackgroundSelectionColor(newColor);

  • Change icon of a non selected node in JTree

    Hello
    I have a swing application contening a JTree.
    I'd like to know how to change the icon of a non selected node in my tree. I have the information about the node and its path. I try to change userObject information and the icon of the node with the setIcon of (DefaultMutableTreeNode), and reload the node (DefaultTreeModel) but it doesn't work.
    Do I have to set the change in my CellRenderer ?
    Any advice will be welcome
    Anne

    If you carefully look at the java tutorial tree, the change is made for all the leaf icon. What I want is to change the icon of a not selected node of my tree while I do other stuff with the other nodes like select, display their contents, drag them ...
    the operation of a not selected node is independant from the selection in the tree.
    So I still ask how to force a node to reload and take care of the change of his icon.
    Anne

  • Coloring selected nodes in JTree

    i am currently using setCellRenderer() for highlighting a selected node in my JTree.but when i select another node, the previously selected node loses its highlight.i would like to know of how i could make the highlight in the selected nodes remain persistent.

    I am currently using DISCONTIGUOUS_TREE_SELECTION only. my requirement is that i should be able to select any number of nodes.so i use this selection.
    but at the same time, my highlight in selected nodes should be like a toggle-state.
    if i select an already selected node ( say A), the highlight has to go away.
    and at the same time, th highlight on previously selected nodes (say B, C) should be persistent.
    am currently using TreeSelectionListener. and for rendering am using SetCellRenderer.
    in this scenario, how could my work be accomplished?

  • How to add nodes to JTree???

    Hi ,
    i'm developing an application using the NetBeans 6.0. I was trying to add the Nodes on the "JMenuItem" Click event.
    I know how to add the customized code to the JTree, but while adding following code to the JMenuItem's Click, does'nt work
    Code :
    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt)
                       DefaultMutableTreeNode dm =new DefaultMutableTreeNode("Root Element");
                       dm.add(new DefaultMutableTreeNode("Child Node"));
                       Treeview=new javax.swing.JTree(dm);
    }        Please help me out where i should write the code so that it will add the nodes to the JTree on JMenuItem's Click.
    Thanks in Advance
    - Hitesh

    Read the tutorial: [Dynamically Changing a Tree|http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#dynamic]

  • How to show only all children of selected node in JTree??

    Dear friends:
    I have Two Panels, PA and PB,
    PA has a Jtree as code below, and PB listens to PA,
    I hope to do following,
    If I select a node called A in PA, then Node A's all children such as A1, A2, A3 will be displayed in PB, but not display A1, A2, A3's children such as A3 has C1, C2, C3, C4 & C5, until I select A3 then PB will display only all A3's children: C1, C2, C3, C4 & C5;
    i.e, only populate each ONE level of children of Node A or any node I select, not its grandchildren and its grand-grand children;
    Please help how to do it??
    I tried amny times, failed.
    Thanks
    [1]. PA panel code:
    package com.atest;
         import java.awt.BorderLayout;
         import java.awt.event.MouseAdapter;
         import java.awt.event.MouseEvent;
         import java.util.Enumeration;
         import java.awt.Dimension;
         import javax.swing.JFrame;
         import javax.swing.JPanel;
         import javax.swing.JScrollPane;
         import javax.swing.JTextField;
         import javax.swing.JTree;
         import javax.swing.tree.DefaultMutableTreeNode;
         import javax.swing.tree.TreeModel;
         import javax.swing.tree.TreePath;
         public class DefaultMutableTreeMain extends JPanel {
         protected DefaultMutableTreeNode    top = new DefaultMutableTreeNode("Options");
         protected DefaultMutableTreeNode      selectedNode = null;
         protected final JTree tree;
         protected final JTextField jtf;
        protected Enumeration      vEnum = null;
         private      TreeModel                m;
         protected  DefaultMutableTreeNode      getDefaultMutableTreeNode()  {
              //textArea.getText();
                   return selectedNode;
         protected  DefaultMutableTreeNode setDefaultMutableTreeNode(DefaultMutableTreeNode tt)  {
              //textArea.getText();
                   selectedNode = tt;
                   return selectedNode;
         protected  TreeModel getJTModel()  {
              //textArea.getText();
                   return m;
         protected  TreeModel setJTModel(TreeModel ta)  {
                   m = ta;
                   return m;
           public DefaultMutableTreeMain() {
             setSize(300,300);
             setLayout(new BorderLayout());
             DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
             top.add(a);
             DefaultMutableTreeNode a1 = new DefaultMutableTreeNode("A1");
             a.add(a1);
             DefaultMutableTreeNode a2 = new DefaultMutableTreeNode("A2");
             a.add(a2);
             DefaultMutableTreeNode a3 = new DefaultMutableTreeNode("A3");
             a.add(a3);
             DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
             top.add(b);
             DefaultMutableTreeNode b1 = new DefaultMutableTreeNode("B1");
             b.add(b1);
             DefaultMutableTreeNode b2 = new DefaultMutableTreeNode("B2");
             b.add(b2);
             DefaultMutableTreeNode b3 = new DefaultMutableTreeNode("B3");
             b.add(b3);
             DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
             a3.add(c);
             DefaultMutableTreeNode c1 = new DefaultMutableTreeNode("C1");
             c.add(c1);
             DefaultMutableTreeNode c2 = new DefaultMutableTreeNode("C2");
             c.add(c2);
             DefaultMutableTreeNode c3 = new DefaultMutableTreeNode("C3");
             c.add(c3);
             DefaultMutableTreeNode c4 = new DefaultMutableTreeNode("C4");
             c.add(c4);
             DefaultMutableTreeNode c5 = new DefaultMutableTreeNode("C5");
             c.add(c5);
             tree = new JTree(top);
             JScrollPane jsp = new JScrollPane(tree);
             jsp.setPreferredSize(new Dimension(400,300));
             add(jsp, BorderLayout.CENTER);
             jtf = new JTextField("", 20);
             add(jtf, BorderLayout.SOUTH);
               tree.addMouseListener(new MouseAdapter() {
               public void mouseClicked(MouseEvent me) {
                  TreePath   path = tree.getSelectionPath();
                  DefaultMutableTreeNode      selectedNode = (DefaultMutableTreeNode)path.getLastPathComponent();
                 TreePath tp = tree.getPathForLocation(me.getX(), me.getY());
                 setDefaultMutableTreeNode(selectedNode);
                     System.out.println("Current node selected is (tp.toString()=" + tp.toString());
                     System.out.println("Current node selected is getDefaultMutableTreeNode()=" + getDefaultMutableTreeNode());
                 if (tp != null){
                     jtf.setText(tp.toString());
                      System.out.println("It Has Children as selectedNode.getChildCount()= " + selectedNode.getChildCount());
                            Enumeration vEnum = selectedNode.children();
                                int i = 0;
                                while(vEnum.hasMoreElements()){
                                    System.out.println("2 selectedNode = " +  path.toString() + "  has " + i++ + " Children in vEnum.nextElement(" + i + ") = " + vEnum.nextElement());
                 else
                   jtf.setText("");
           public static void main(String[] args) {
             JFrame frame = new JFrame();
             frame.getContentPane().add(new DefaultMutableTreeMain());
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             frame.setSize(400, 400);
             frame.setVisible(true);
         }[2]. PB Panel code
    package com.atest;
    import java.awt.BorderLayout;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.JPanel;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.*;
    import javax.swing.JButton;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class DefaultMutableTreeSub extends JPanel implements java.io.Serializable{
      private JButton removeButton;
      private JButton addButton;
      JTree tree;
      private TreeModel      m;
      protected TreeDragSource ds;
      protected TreeDropTarget dt;
    protected  TreeModel getJTModel()  {
              //textArea.getText();
                   return m;
    protected  TreeModel setJTModel(TreeModel ta)  {
                   m = ta;
                   return m;
    protected DefaultTreeModel model;
    protected DefaultMutableTreeNode rootNode;
    DefaultMutableTreeMain dmm = null;
    JPanel inputPanel  = new JPanel();
      public JPanel SLTreeDNDEditableDynamic(DefaultMutableTreeMain tdnd ) {
        //super("Rearrangeable Tree");
        setSize(400,450);
        dmm = tdnd;
             setLayout(new BorderLayout());
             inputPanel.setLayout(new BorderLayout());
             JPanel outputPanel = new JPanel();
             System.out.println("Sub selectedNode tdnd= " + tdnd);
             tdnd.tree.addTreeSelectionListener(new TreeSelectionListener(){
                  public void valueChanged(TreeSelectionEvent evt){
                  TreePath[] paths = evt.getPaths();
                  TreePath   path = dmm.tree.getSelectionPath();
                  DefaultMutableTreeNode      selectedNode = (DefaultMutableTreeNode)path.getLastPathComponent();
                 DefaultMutableTreeNode itemNode = dmm.getDefaultMutableTreeNode();
                     System.out.println("Sub node selected is dmm.getDefaultMutableTreeNode()=" + dmm.getDefaultMutableTreeNode());
                  model = new DefaultTreeModel(itemNode);
                  tree = new JTree(model);
                  System.out.println("Sub selectedNode paths= " + paths);
                  System.out.println("Sub selectedNode path= " + path);
                  System.out.println("Sub selectedNode = " + selectedNode);
                  System.out.println("Sub itemNode = " + itemNode);
                  tree.putClientProperty("JTree.lineStyle", "Angled");
                  tree.setRootVisible(true);
                   inputPanel.add(new JScrollPane(tree),BorderLayout.CENTER);
             return inputPanel;
         public DefaultMutableTreeSub() {
              super();
    }thanks
    sunny

    Thanks so much, I use your code and import followig:
    import java.util.ArrayList;
    import java.awt.List;
    but
    private static List<Object> getChildNodes(JTree j) {
         Object parent = j.getLastSelectedPathComponent();
         int childNodeCount = j.getModel().getChildCount(parent);
         List<Object> results = new ArrayList()<Object>;
         for (i = 0; i < childNodeCount; i++) {
              results.add(parent, i);
         return results;
    here List<Object> and ArrayList()<Object> show red,
    Is my JDK version problem??
    my one is JKD
    C:\temp\swing>java -version
    java version "1.4.2_08"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
    Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
    Error as follows:
    C:\temp\swing>javac DefaultMutableTreeSub.java
    DefaultMutableTreeSub.java:38: <identifier> expected
    private static List<Object> getChildNodes(JTree j) {
    ^
    1 error
    any idea??
    Thanks

  • How to rename node in JTree?(URGENT)

    Hi,all:
    I am facing a renaming problem in JTree. After I rename, the node still remain the old name, Could anybody tell me why and how to solve it?
    The piece of code is as follow:
    JTextField textField = new JTextField();
    newDndTree.setCellEditor(new MyCellEditor(newDndTree,textField));
    newDndTree.setEditable(true);
    class MyCellEditor extends DefaultCellEditor {
    private JTree tree;
    public MyCellEditor(JTree tree, JTextField text) {
    super(text);
    this.tree = tree;
    public boolean isCellEditable(EventObject e) {
    boolean rv = false; // return value
    if(e instanceof MouseEvent) {
    MouseEvent me = (MouseEvent)e;
    if(me.getClickCount() == 3) {
    TreePath path =
    tree.getPathForLocation(me.getX(), me.getY());     
    if(path.getPathCount() == 1) // root node
    return false;
    DefaultMutableTreeNode node =
    (DefaultMutableTreeNode) path.getLastPathComponent();
    Object hitObject=path.getLastPathComponent();
    if(hitObject instanceof TreeNode)
    return (((TreeNode)hitObject).isLeaf());
    return (false);

    Hi,all:
    My problem is it doesn't rename the node, the node remain the old name.
    My piece of code as follow:
    //Set Cell Editor
    newDndTree.setCellEditor(new MyCellEditor());
    //inner class MyCellEditor
    class MyCellEditor extends DefaultCellEditor {   
    public MyCellEditor() {     
    super(new JTextField());
    public boolean isCellEditable(EventObject e) {     
    if(e instanceof MouseEvent) {     
    MouseEvent me = (MouseEvent)e;     
    if(me.getClickCount() == 3) {      
    JTree tree = (JTree)me.getSource();     
    TreePath path = tree.getPathForLocation(me.getX(), me.getY());     
    if(path.getPathCount() == 1) {        
    //System.out.println("Root");     
    return false; // root node     
    DefaultMutableTreeNode node =     
    (DefaultMutableTreeNode) path.getLastPathComponent();     
    Object hitObject=path.getLastPathComponent();     
    if(hitObject instanceof TreeNode) {        
    TreeNode t = (TreeNode)hitObject;     
    boolean b = t.isLeaf();     
    if (b) {          
    //System.out.println("Leaf");     
    return (((TreeNode)hitObject).isLeaf());     
    //else System.out.println("Not Leaf");     
    // System.out.println("Exit");
    return false;
    }

  • How to highlight node in JTree?

    After the tree has been displayed, I want to highlight the nodes matching some certain keywords. How to implement that? Nothing useful is found in past threads.
    thanks.

    to take a wild guess:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    public class HighlightTreeNodeTest {
      private final JTree tree       = new JTree();
      private final JTextField field = new JTextField("foo");
      private final JButton button   = new JButton();
      private final MyTreeCellRenderer renderer =
        new MyTreeCellRenderer(tree.getCellRenderer());
      public JComponent makeUI() {
        field.getDocument().addDocumentListener(new DocumentListener() {
          @Override public void insertUpdate(DocumentEvent e) {
            fireDocumentChangeEvent();
          @Override public void removeUpdate(DocumentEvent e) {
            fireDocumentChangeEvent();
          @Override public void changedUpdate(DocumentEvent e) {}
        tree.setCellRenderer(renderer);
        renderer.q = field.getText();
        fireDocumentChangeEvent();
        JPanel p = new JPanel(new BorderLayout(5, 5));
        p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        p.add(field, BorderLayout.NORTH);
        p.add(new JScrollPane(tree));
        return p;
      private void fireDocumentChangeEvent() {
        String q = field.getText();
        renderer.q = q;
        TreePath root = tree.getPathForRow(0);
        collapseAll(tree, root);
        if (!q.isEmpty()) searchTree(tree, root, q);
        tree.repaint();
      private static void searchTree(JTree tree, TreePath path, String q) {
        TreeNode node = (TreeNode)path.getLastPathComponent();
        if (node==null) return;
        if (node.toString().startsWith(q)) tree.expandPath(path.getParentPath());
        if (!node.isLeaf() && node.getChildCount()>=0) {
          Enumeration e = node.children();
          while (e.hasMoreElements())
            searchTree(tree, path.pathByAddingChild(e.nextElement()), q);
      private static void collapseAll(JTree tree, TreePath parent) {
        TreeNode node = (TreeNode)parent.getLastPathComponent();
        if (!node.isLeaf() && node.getChildCount()>=0) {
          Enumeration e = node.children();
          while (e.hasMoreElements()) {
            TreeNode n = (TreeNode)e.nextElement();
            TreePath path = parent.pathByAddingChild(n);
            collapseAll(tree, path);
        tree.collapsePath(parent);
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          @Override public void run() { createAndShowGUI(); }
      public static void createAndShowGUI() {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.getContentPane().add(new HighlightTreeNodeTest().makeUI());
        f.setSize(320, 240);
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    class MyTreeCellRenderer extends DefaultTreeCellRenderer {
      private final TreeCellRenderer renderer;
      public String q;
      public MyTreeCellRenderer(TreeCellRenderer renderer) {
        this.renderer = renderer;
      @Override public Component getTreeCellRendererComponent(
          JTree tree, Object value, boolean isSelected, boolean expanded,
          boolean leaf, int row, boolean hasFocus) {
        JComponent c = (JComponent)renderer.getTreeCellRendererComponent(
            tree, value, isSelected, expanded, leaf, row, hasFocus);
        if (isSelected) {
          c.setOpaque(false);
          c.setForeground(getTextSelectionColor());
        } else {
          c.setOpaque(true);
          if (q!=null && !q.isEmpty() && value.toString().startsWith(q)) {
            c.setForeground(getTextNonSelectionColor());
            c.setBackground(Color.YELLOW);
          } else {
            c.setForeground(getTextNonSelectionColor());
            c.setBackground(getBackgroundNonSelectionColor());
        return c;
    }

  • How to select nodes for passing to a template

    How can I write an xpath to select only the row contained in rowset that has a child node language with the value of en-us
    ie something like
    select=rowset/row where rowset/row/child='en-us'
    Tks
    Rob

    Assuming that your xml looks like:
    <rowset>
    <row>
    <language>en-us</language>
    :Then it would be:
    select="rowset/row[language='en-us']"
    For a good introduction and tutorial to XML, XPath and XSLT, among other things, you can check out my book Building Oracle XML Applications.
    Steve Muench
    Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
    Author, Building Oracle XML Applications
    null

  • How to select a small area without a low feather???

    When i select a small area with the lasso tool i get the warning: 'no pixels are more than 50% selected. The selected edge will not be visible.'
    I already read that the feather should me low. However if i do that, the outcome wont be nice.
    I want to bleach teeth and when i use a small feather the teeth wont be selected very well. So how can i solve this problem??
    (I am sorry if my english is not that well, i am from the Netherlands )
    I hope someone can help me with this.
    greetings stephanie

    You can use the lasso tool without any Feather (set feather to 0) keep anti-alias checked and use Refine Edge to add any feathering if needed.
    You might make a layer mask from the selection and then use the brush tool to refine the mask.
    When you get that message you still have a selection, but elements is letting you know that any pixels selected less than 50% won't be visible with the marching ants. (the selection edge you see
    when using any of the selection tools)
    What version of photoshop elements are you using?
    Message was edited by: R_Kelly

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • Hiding a intermediate node in a Jtree without hiding leaf nodes

    Hi who can help me out of this problem. What my prob is dat i m interrested in hiding few intermediate nodes in JTree without hiding their children.
    Thanks
    Rakesh

    but how do you then expand to see the children? once the node is hidden, can you by any means expand/collapse it to view/hide the child leaves?

  • Get node jtree without click

    hi all,
    I want get node from jtree without click, just with mouse in node.
    I look in google but dont find nothing...
    I try use listener but MousePressed dont help-me.
    thanks

    jTree1 = new JTree1(treeModel);Sorry, now
    jTree1 = new JTree(treeModel);
    MouseMotionListener mm = new MouseMotionListener(){
          public void mouseMoved(MouseEvent e) {
                System.out.println("moved "+e.getX()+" "+e.getY());
                 int selRow = jTree1.getRowForLocation(e.getX(), e.getY());
                TreePath selPath = jTree1.getPathForLocation(e.getX(), e.getY());
                if(selRow != -1) {
                                    System.out.println("mouse moved..."+selPath);
        public void mouseDragged(MouseEvent e) {
                   System.out.println("dragged "+e.getX()+" "+e.getY());
    jTree1.addMouseMotionListener(mm);
    jScrollPane1.setViewportView(jTree1);

  • How could i get the selected node in the JTree

    getLastSelectedPathComponent() �returns the parent node of currenr selected, so how could I get the selected node itself in the JTree
    I will appretiate for any help!

    i think you can get by....
    TreePath treePath = tree.getSelectionPath();
    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();

  • Perform drag&drop in Jtree without even selecting a node once?

    Hi All,
    Is it possible to perform drag and Drop action on tree nodes even when the Jtree is not active.
    That is, say a jtree is not active and i directly want to drag a node inside it without even selecting it once?
    Thanks alot in Advance.

    You should google for "jtree drag and drop". I remember seeing a very nice tutorial on codeproject.
    If your run into any specific issue let me know.

Maybe you are looking for

  • Is it possible to keep the text in an internal linked object?

    I have created a button with a text field. This is an internal linked object. I was hoping to be able to edit the text for each instance of the button. But still be able to later change the look. Is there a way to preserve the local text edits? Thank

  • Bringing instrument interface into view.

    Whenever I wish to get into either an instrument or effect from within the inspector by clicking on it's tab, I have to click many times before it appears. I have just bought a new mighty mouse so I know it's not that. Any ideas?

  • Forms N reports Services (Runtime Problem)?

    i have installed OAS10g Forms and Reports Services recently. it's working fine Now i want to Use Oracle 10gDS on 2nd Machine and i have define the "Runtime preference" as http:\\Frm_n_rpt_srvs(host):7778/forms90/f90servlet but it gives the error in r

  • GarageBand will not open. How do I fix this issue?

    Just purchased this IMac and whenevr i try to open garageband its quits and gives an error message that the program quit unexpectedlt.  I tried reinstalling the program and it still gives the same problem.  How do I fix this isssue?

  • Preloader code will not start next frame when finished

    I have this code in frame 1 "stop(); //Preloader loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader); function updatePreloader(evtObj:ProgressEvent):void //container for the progress of the site (download) var percent:Number = Math.f