How to use JTree?

hi,
I need of an object that allows me to choose a directory path, and I think JTree do this.
But I never have used it;
I have read Java tutorial, but I don't know how to do to show in JTree my hard disk partition and directory.
Then, I must create a class that manages JTree or I can create it directly where it is needed?
Do Can you post me some code line showing the correct use of it?
Thanks.

Look at this, and copy what you need
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
import java.io.*;
public class TreeSP extends JFrame implements ActionListener
     JTree              jtR;
     JTree              jtL;
     JSplitPane        jsP1,jsP2;
     JScrollPane        jsL;
     JScrollPane     jsR;
     JButton               jbc,jbd;
     Tpan               panel  = new Tpan();
     int                  from   = -1;
     int                  mark   = -1;
     Point                 toP    = new Point(0,0);
     Vector          frV    = new Vector();
     Vector          toV    = new Vector();
     DefaultTreeCellRenderer tcl = new MyTreeCellRenderer();
public TreeSP() 
     setBounds(1,1,700,400);     
     getContentPane().setLayout(new BorderLayout());
     addWindowListener(new WindowAdapter()
     {     public void windowClosing(WindowEvent ev)
          {     dispose();
               System.exit(0);
     LeftTree();
     RightTree();
     jsL = new JScrollPane(jtL);
     jsL.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
     jsR = new JScrollPane(jtR);
     addAdjustmentListener(jsR);
     addAdjustmentListener(jsL);
     JPanel stam = new JPanel();
     stam.addMouseListener(new MouseAdapter()     
     {     public void mousePressed(MouseEvent m)
               panel.findLine(m.getX(),m.getY());
     jsP2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,stam,jsR);
     jsP1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,jsL,jsP2);
     jsP2.setBorder(null);
     jsP1.setDividerSize(8);
     jsP2.setDividerSize(10);
     jsP2.setDividerLocation(190);
     panel.add("Center",jsP1);
     getContentPane().add("Center",panel);
     JPanel butt = new JPanel();
     butt.setPreferredSize(new Dimension(0,25));
     butt.setLayout(new GridLayout(0,5,10,10));     
     butt.setBorder(new EmptyBorder(4,1,0,0));
     getContentPane().add("South",butt);
     jbc = new JButton("Connect");
     butt.add(jbc);
     jbc.addActionListener(this);
     jbd = new JButton("DisConnect");
     butt.add(jbd);
     jbd.addActionListener(this);
     setVisible(true);     
private void addAdjustmentListener(JScrollPane jsp)
     jsp.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener()
     {     public void adjustmentValueChanged(AdjustmentEvent a)
               panel.repaint();
     jsp.getHorizontalScrollBar().addAdjustmentListener(new AdjustmentListener()
     {     public void adjustmentValueChanged(AdjustmentEvent a)
               panel.repaint();
public void actionPerformed(ActionEvent ae)
     if (ae.getSource() == jbc) connect();
     if (ae.getSource() == jbd)
          if (mark > -1 && panel.calculateLine(mark)) 
               frV.remove(mark);
               toV.remove(mark);
               mark = -1;
               panel.repaint();
          else(disConnect());
private void doNode(DefaultMutableTreeNode aba, File ifile)
     String[] progs = ifile.list();
     for (int pri=0; pri < progs.length; pri++)
          File f = new File(ifile.getPath()+"/"+progs[pri]);
          if (f.isFile())
               aba.add(new DefaultMutableTreeNode(f.getName()));
          if (f.isDirectory())
               if (f.isHidden())
//                    aba.add(new DefaultMutableTreeNode("Hd> "+file));
               else
                    DefaultMutableTreeNode dry = new DefaultMutableTreeNode(f.getName());
                    aba.add(dry);
                    doNode(dry,f);
private void LeftTree()
     File file = new File(System.getProperty("user.dir"));     
     DefaultMutableTreeNode rot = new DefaultMutableTreeNode(file.getAbsolutePath());
     doNode(rot,file);
     jtL = new JTree(rot);  
     jtL.setCellRenderer(tcl);
     jtL.putClientProperty("JTree.lineStyle", "Angled");
     jtL.addMouseListener(new MouseAdapter()     
     {     public void mousePressed(MouseEvent m)
               from  = jtL.getClosestRowForLocation(m.getX(),m.getY());
               toP.setLocation(-1,-1);
               jtL.setSelectionRow(from);
               panel.repaint();
          public void mouseReleased(MouseEvent m)
               int x = m.getX() - jsR.getX() + 4;
               Rectangle vl = jsL.getViewport().getViewRect();     
               Rectangle vr = jsR.getViewport().getViewRect();     
               if (x > 1)
                      int t = jtR.getClosestRowForLocation(x,m.getY()-vl.y+vr.y);
                    jtR.setSelectionRow(t);
                    connect();     
               from = -1;
               panel.repaint();
     jtL.addMouseMotionListener(new MouseMotionAdapter()          
     {     public void mouseDragged(MouseEvent m)
               if (from > -1)
                    toP.setLocation(m.getX()+4+12,m.getY()+2);
                    panel.repaint();
private void RightTree()
     File file = new File(System.getProperty("user.dir"));     
     DefaultMutableTreeNode rot = new DefaultMutableTreeNode(file.getAbsolutePath());
     doNode(rot,file);
     jtR = new JTree(rot);  
     jtR.setBorder(new EmptyBorder(0,12,0,0));
     jtR.setCellRenderer(tcl);
     jtR.addMouseListener(new MouseAdapter()     
     {     public void mousePressed(MouseEvent m)
               panel.repaint();
          public void mouseReleased(MouseEvent m)
               panel.repaint();
private void connect()
     TreePath fl = jtL.getPathForRow(jtL.getMinSelectionRow());
     TreePath fr = jtR.getPathForRow(jtR.getMinSelectionRow());
     if (fl == null || fr == null) return;
     frV.add(fl);
     toV.add(fr);
     panel.repaint();
private void disConnect()
     TreePath fl = jtL.getPathForRow(jtL.getMinSelectionRow());
     TreePath fr = jtR.getPathForRow(jtR.getMinSelectionRow());
     if (fl == null || fr == null) return;
     frV.remove(fl);
     toV.remove(fr);
     panel.repaint();
public class Tpan extends JPanel
     Rectangle    ll;
     Rectangle    rr;
public Tpan()
     setLayout(new BorderLayout());
private void findLine(int x, int y)
     x = x + jsP2.getX();
     for (int k=0; k < frV.size(); k++)
          if (calculateLine(k))
               Rectangle vl = jsL.getViewport().getViewRect();     
               Rectangle vr = jsR.getViewport().getViewRect();     
               Line2D line = new Line2D.Double(ll.x,ll.y-vl.y,rr.x,rr.y-vr.y);
               if (line.ptLineDist(x,y) < 2)
                    mark = k;
                    repaint();
                    return;
     if (mark != -1)     
               mark = -1;
               repaint();
public void paint(Graphics g)
     super.paint(g);
     myPaint(g);     
public void myPaint(Graphics g1)
     g1.setColor(Color.black);
     Graphics2D g = (Graphics2D)g1;
     g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);          
     for (int k=0; k < frV.size(); k++)
          if (calculateLine(k))
               Rectangle vl = jsL.getViewport().getViewRect();     
               Rectangle vr = jsR.getViewport().getViewRect();     
//               if (vl.contains(1,ll.y) || vr.contains(1,rr.y))
                    if (k == mark)      g.setColor(Color.red);
                         else        g.setColor(Color.black);     
                    int o = getOfset(frV.get(k)); 
                    g.drawLine(o,ll.y-vl.y,ll.x,ll.y-vl.y);
                    g.drawLine(ll.x,ll.y-vl.y,rr.x,rr.y-vr.y);
                    int l = getEnd(toV.get(k));
                    g.fillRect(rr.x,rr.y-vr.y,l,1);
                    g.drawLine(rr.x+l,rr.y-vr.y-2,rr.x+l+7,rr.y-vr.y);
                    g.drawLine(rr.x+l,rr.y-vr.y+2,rr.x+l+7,rr.y-vr.y);
     g.setColor(Color.gray);     
     if (from > -1 && toP.x > -1)
          Rectangle ll = jtL.getRowBounds(from);
          Rectangle vl = jsL.getViewport().getViewRect();
          ll.x = getStart();
          ll.y = ll.y + ll.height/2 - vl.y + 1;
          g.drawLine(ll.x,ll.y,toP.x,toP.y-vl.y);
private boolean calculateLine(int k) // to calculate the line Points in Tpan
     TreePath f1 = (TreePath)frV.get(k);
     if (f1 == null) return(false);
     ll   = jtL.getPathBounds(f1);
     ll.x = jsL.getX()+jsL.getWidth();
     ll.y = ll.y + ll.height/2 + 2;
     TreePath f2 = (TreePath)toV.get(k);     
     if (f2 == null) return(false);
     rr   = jtR.getPathBounds(f2);
     rr.y = rr.y + rr.height/2 + 2;
     rr.x = jsP2.getX()+jsP2.getDividerLocation()+jsP2.getDividerSize()-1;
     return(true);
private int getOfset(Object o) // to calculate where to start the horizntal
{                              // line on the left side
     Rectangle r = jtL.getPathBounds((TreePath)o);
     Point     p = jsL. getViewport(). getViewPosition();
     int       n = Math.max(0,r.x + r.width - p.x);
     if (jsL.getVerticalScrollBar().isVisible()) n = n+18;
     if (jsL.getWidth() < n) n = jsL.getWidth();
     return(n);
private int getStart()        // to calculate where to start the draging line
     TreePath f = jtL.getPathForRow(jtL.getMinSelectionRow());
     return(getOfset(f));
private int getEnd(Object o)  // to calculate where to end the horizontal
{                                     // ot the right side
     Rectangle r = jtR.getPathBounds((TreePath)o);
     Point     p = jsR. getViewport().getViewPosition();
     int       n = Math.max(0,r.x - p.x - 7);
     return(n);
public class MyTreeCellRenderer extends DefaultTreeCellRenderer
     ImageIcon   i1   = new ImageIcon("attribute.gif");
     ImageIcon   i2   = new ImageIcon("condition.gif");
public MyTreeCellRenderer()
     super();
     setFont(new Font("",1,11));
     super.setLeafIcon(i1);
     super.setOpenIcon(i2);
public Component getTreeCellRendererComponent(JTree   tree,
                                              Object  value,
                                              boolean selected,
                                              boolean expanded,
                                              boolean leaf,
                                              int     row,
                                              boolean hasFocus)
     super.getTreeCellRendererComponent(tree,value,
                                            selected,
                                               expanded,
                                            leaf,
                                            row,
                                            hasFocus);
     return(this);     
public static void main (String[] args)
     new TreeSP();
}      Noah

Similar Messages

  • Help! third time ask the question: how to use JTree?

    i want to use JTree with nicer style, that is:
    "line starts at root and has lines ..." (C++ word)
    i downloded all samples but i can't find any.
    if u did it before or know where to download the examples which have this style of JTree, please let me know.
    thank u.

    Are you looking for a tree like the one you find in the Windows Explorer's Left Side? Can you describe more on what you want. Did you visit the Java Tutorial? They have some material in the Swings about Trees.

  • How to use Jtree to load some directory?

    Hello everyone, I need use JTree to show the whole files and directories from some one directory(such as C:/test/javademo), so could you please give me some
    idea about that, thanks a million.
    Yours Leon

    I actually think recursion is a bad idea - why load all the subfolders and files into the tree recursively at the beginning? This will just take more time and disk access (think slow) which is unneeded. Below is the tutorial to write a JTree with a treeWillExpand listener. What you'll want to do is have it init a root DefaultMutableTreeNode to whatever folder you want it to begin at. Then you'll add children to that DefaultMutableTreeNode to represent the folder's contents (files and folders). At the point where the user wishes to expand a directory, the TreeWillExpand method will be called, you can get the path of DefaultMutableTreeNodes and use that to reference into the disk to load up the folder's children.
    I probably made that more complex sounding than it needed to be. Check out this sun tutorial and code examples:
    http://java.sun.com/docs/books/tutorial/uiswing/events/treewillexpandlistener.html

  • How to use Vector or other ArrayList etc to store my JTree??

    How to use Vector or other ArrayList etc to store my JTree??
    Dear friends,
    I have following I posted before, but not get satisfactory answer, so I modify and repost again here.
    I have following code can add classes and students in the JTree,
    in class Computer Science, it has student Bill Brien,
    in Math, no,
    Then I I add Student Nancy, Laura, Peter into Computer Science Class,
    add AAAA, BBB, CCC into Math class,
    I create a new class called Chemistry, then I add DDD int Chemistry;
    so this JTree is dynamically changed,
    [1]. How can I dynamically save my current JTree with all above tree structure and its nodes in a Vector or ArrayList(not sure which one is best)??
    see code below:
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    public class ModelJTreeTest extends JFrame {
      private JTree tree;
      private DefaultTreeModel model;
      private DefaultMutableTreeNode rootNode;
      public ModelJTreeTest() {
        DefaultMutableTreeNode philosophersNode = getPhilosopherTree();
        model = new DefaultTreeModel(philosophersNode);
        tree = new JTree(model);
        JButton addButton = new JButton("Add Class/Students");
        addButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            addPhilosopher();
        JButton removeButton = new JButton("Remove Selected Class/Students");
        removeButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            removeSelectedPhilosopher();
        JPanel inputPanel = new JPanel();
        inputPanel.add(addButton);
        inputPanel.add(removeButton);
        Container container = getContentPane();
        container.add(new JScrollPane(tree), BorderLayout.CENTER);
        container.add(inputPanel, BorderLayout.NORTH);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(400, 300);
        setVisible(true);
      private void addPhilosopher() {
        DefaultMutableTreeNode parent = getSelectedNode();
        if (parent == null) {
          JOptionPane.showMessageDialog(ModelJTreeTest.this, "Select Class", "Error",
              JOptionPane.ERROR_MESSAGE);
          return;
        String name = JOptionPane.showInputDialog(ModelJTreeTest.this, "Add Class/Students:");
        model.insertNodeInto(new DefaultMutableTreeNode(name), parent, parent.getChildCount());
      private void removeSelectedPhilosopher() {
        DefaultMutableTreeNode selectedNode = getSelectedNode();
        if (selectedNode != null)
          model.removeNodeFromParent(selectedNode);
      private DefaultMutableTreeNode getSelectedNode() {
        return (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
      private DefaultMutableTreeNode getPhilosopherTree() {
        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Students");
        DefaultMutableTreeNode ancient = new DefaultMutableTreeNode("Computer Science");
        rootNode.add(ancient);
        ancient.add(new DefaultMutableTreeNode("Bill Brian"));
        DefaultMutableTreeNode math = new DefaultMutableTreeNode("Maths");
        rootNode.add(math);  
        DefaultMutableTreeNode physics = new DefaultMutableTreeNode("Physics");
        rootNode.add(physics);
        return rootNode;
      public static void main(String args[]) {
        new ModelJTreeTest();
    }the actual Tree dynamically created somehow looks like following:
                             |            1.Peter
                             |---CS---    2. Nancy
                             |            3. Laura
                             |            4.Brian
                             |
    Root(University): -------|---Math- 1.AAA
                             |            2.BBB
                             |            3.CCC
                             |
                             |
                             |---Chemistry- 1. DDDThanks a lot
    Good weekends

    you can't directly store a tree in a list.Ummm... Just to be contrary... Yes you CAN store a tree in a table.... In fact that's how the windows file system works.
    Having said that... you would be well advised to investigate tree data-structures before resorting to flattening a tree into a list.
    So... Do you have a specific requirement to produce a List? Your umming-and-erring about Vector vs ArrayList makes it sound like you're still at the stage of choosing a datastructure.
    Cheers. Keith.

  • How to use renderer for a Jtree Element

    Hi all,
    i have been told to use Renderer for drawing a JTree on a JPanel.
    I mean, i want to draw each element of the JTree as a rectangle with a label inside it.....each element of my JTree contains an UserObject with a string inside it.
    Any suggestions ?
    Cheers.
    Stefano

    read the link below it shows how to use trees and tree renderer.
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

  • How to use Tooltips with JTree

    Hi to all,
    i need to show tool tip with on mouse over event on JTree. Tooltip text should be
    dynamic and its value depends on tree node.
    i did't implemented tooltips as of now. i have visited some sites but i did't
    get good information. Please suggest me that wher to start this.
    Thanking You

    Sun's JTree tutorial has an example that shows how to use tool tips in JTrees:
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    Look at the TreeIconDemo2.java example.

  • JTree how to use different font's color for different node

    Hi all
    This is the first time I am using JTree in my application and I have got some problems with it that I can't work out after reading the Java tutorial. Please help!
    1. For some nodes, the font color need to be different.
    2. One node need to use more than one font type for example "This is a sample " some words need to be bolded.
    Kind regards
    Edmond

    Did you read the section on [url http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display]Customizing a Tree's Display?
    And did you follow the link on renderers?

  • Urgent ..How to use Tree component in a web based interface

    I want to make a Java web based windows explorer type interface.
    For that i want to use tree component .
    Is it possible for me to do this.
    Can anybody suggest me how to do ?

    Hi,
    I assume you plan to do this in a browser and you plan to use JTree. When using an applet, you'd have to make sure that the latest Java Plug-In is available on the client.
    If you not plan to use JTree, you could use a Tree component which is not based on swing such as the one at http://www.calcom.de/eng/dev/cctree.htm
    In this case still the browser would have to be 'Java enabled' by any kind of plug-in
    Ulrich

  • How to Refresh JTree if a file System got changed during Run-time

    Hi,
    Can anyone tell me how to refresh a JTree(javax.swing.JTree) used for displaying file system(both local and remote).
    I'm getting a problem if a file/directoy is added to the file system, after my Applet is loaded. Actually, i have used DefaultTreeModel's reload() method for refreshing and calling it inside SwingUtilities.invokeLater() using Thread, but its not working.
    I want that the tree should reflect the latest Files/Directories on the click of a node, if any file or directory is added under that node.
    Plz tell me if this is possible or not.
    Thanks

    Hi Shay_te,
    Thanx for ur reply as i was eagerly waiting for the one.
    but the example is using the TreeTable
    and i have used JTree and DefaultTreeModel.
    I'm calling reload(node) within treeExpand() method
    Then, i'm regestring addTreeModelListener() as
    m_model.addTreeModelListener(new javax.swing.event. TreeModelListener(){ }
    inside which all 4 methods are over-ridden
    code snippet is as follows so plz help me and tell if this the right way:
    class DirExpansionListener implements TreeExpansionListener{
            DirExpansionListener(){
            public void treeExpanded(TreeExpansionEvent event) {
                final DefaultMutableTreeNode node = getTreeNode(event.getPath());
                final FileNode fnode = getFileNode(node);
                Thread runner = new Thread() {
                    public void run() {
                        if (fnode != null && fnode.expand(node)) {
                            Runnable runnable = new Runnable() {
                                public void run() {
                                    try{
                                       m_model.reload(node);
                                        m_model.addTreeModelListener(new javax.swing.event.TreeModelListener() {
                                            public void treeNodesChanged(javax.swing.event.TreeModelEvent evt) {
                                            public void treeStructureChanged(javax.swing.event.TreeModelEvent evt) {
                                                System.out.println("Path of node changed->"+evt.getTreePath());
                                            public void treeNodesInserted(javax.swing.event.TreeModelEvent evt) {
                                                System.out.println("Nodes Inserted method called..");
                                            public void treeNodesRemoved(javax.swing.event.TreeModelEvent evt) {
                                        System.out.println("Run inside DEvent called..");
                                        //Thread.sleep(500);
                                        //fnode.expand(node);
                                    }catch(Exception e){System.out.println("err :" +e);}
                            SwingUtilities.invokeLater(runnable);
                runner.start();
            public void treeCollapsed(TreeExpansionEvent event) {}
        Please reply...

  • Is it possible to use JTrees to create a File Manager??

    -- I'm wonderin on how can i use JTrees to view my entire system file...
    i want to create a FileManager apps wherein you can navigate your file system like navigating a windows explorer....
    Thanks

    You can in fact I once did it.
    All you have to do is to define a root node class which will have all the Directory roots as its childs.
    And another node class that represents a file or a folder in the disk.

  • How to use GUI to display AVL tree.-Urgent

    Hi,
    I implemented the insertion of the AVL Tree, it worked fine. but i do not know how to use the GUI to display the tree befor and after the insertion.
    Could you please help me,
    thanks,

    Have you considered using JTree?

  • How to remove JTree +/- button?

    I already have my own +/- icon(leafticon, openIcon, closeIcon) but JTree has default +/- button so it is become doube, so how to remove +/- JTree default button?
    thx...

    DarrylBurke wrote:
    IMO the correct way to go about this is to substitute your custom icons for the default ones using UIManager. Don't forget to wrap the icon as a UIResource or it may not be recognized by some LaFs (may still not be recognized by some LaFs, but you increase your chances by using a UIResource ...)UIManager.put("Tree.expandedIcon", new IconUIResource(myCustomExpandedIcon));
    UIManager.put("Tree.collapsedIcon", new IconUIResource(myCustomCollapsedIcon));dbyap it work. but i want to remove it, so i set to the non exist icon and it is gone. is it right or not?
    ImageIcon icon = new ImageIcon("c:\\iconNonexist.png"); // actually the image is not there
    UIManager.put("Tree.expandedIcon", new IconUIResource(icon)); // work the +/- is gone
    UIManager.put("Tree.collapsedIcon", new IconUIResource(icon)); // work the +/- is gone
    // UIManager.put("Tree.expandedIcon","none"); // not work

  • Problems using JTree

    Using JTree, I can modify the name of an element clicking on the element two times. But, how can I do to invoke externally this operation (for example using a popup menu, as when you modify the name of an icon in your desktop) without using double-click ?
    Is it clear?
    Thanks in advance!!!!
    lucignolo

    Do you think that is it possible?
    thanks
    lucignolo

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

  • Can't figure out how to use home sharing

    Since the latest couple iTunes updates, my family and I can not figure out how to use home sharing. Everyone in our household has their own iTunes, and for a long time we would just share our music through home sharing. But with the updates, so much has changed that we can no longer figure out how to use it.
    I have a lot of purchased albums on another laptop in the house, that im trying to move it all over to my own iTunes, and I have spent a long time searching the internet, and everything. And I just can't figure out how to do it. So.... how does it work now? I would really like to get these albums from my moms iTunes, onto mine. I would hate to have to buy them all over again.
    If anyone is able to help me out here, that would be great! Thanks!

    The problem im having is that after I am in another library through home sharing, I can't figure out how to select an album and import it to my library. They used to have it set up so that you just highlight all of the songs you want, and then all you had to do was click import. Now I don't even see an import button, or anything else like it. So im lost... I don't know if it's something im doing wrong, or if our home sharing system just isn't working properly.
    Thanks for the help.

Maybe you are looking for