How tos....JTree

To all Java developers out there:
Hi! I would just like to ask for help regarding the implementation of JTrees.
I am trying to make a JTree with an unknown number of directories or files. I have an Application folder. This folder may contain files, subfolders, subfolders with files, subfolders with subfolders with files...etc...The contents of this folder is unkown, that is why I wanted the JTree to be dynamic. Dynamic in the sense that whenever a new file or a new folder or a new subfolder is added, it can automatically be reflected on the JTree which I am trying to make.
Can someone please advise?? Thanks a lot. I appreciate it...

Hi Dev
At first glance, what I think you need is some code
to recursively go through the contents of a folder.
You can feed this information to build a 'tree' of
nodes which you can then pass onto your JTree. I tried to do that but I had a problem with directories. Since the Root folder can contain more than one subfolder, i am not able to get the correct "path name". I am only able to get the subdirectories of one folder.
Root
|_ Folder A
|_ File A
|_Folder B
|_ File B
|_Folder C
I can only get the contents of Folder A but i cannot reach Folder B and Folder C anymore...Maybe there is something wrong with my code...
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
import java.io.*;
import java.util.*;
import java.util.logging.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import javax.swing.tree.*;
import java.lang.*;
public class ApplicationTree extends JFrame // implements TreeModelListener
     JTree ApplicationTree;
     String fileName = null;
     File fApp;
     public ApplicationTree()
          boolean bValid = checkFile("Library/components/applications");
          if(bValid)
               fApp = new File("Library/components/applications/");          
               DefaultMutableTreeNode dmtnRoot = new DefaultMutableTreeNode("Applications");
               String[] sApp = fApp.list();
          StringBuffer sbApp = new StringBuffer("Library/components/applications/");
          createNodes(dmtnRoot, sApp, sbApp);
               ApplicationTree = new JTree(dmtnRoot, true);
          ApplicationTree.setDragEnabled(true);
          this.getContentPane().add(ApplicationTree);
          this.setSize(300, 200);
          this.setVisible(true);
     public void createNodes(DefaultMutableTreeNode admtnApp, String[] asApp, StringBuffer asbApp)
          for (int nCount = 0; nCount < asApp.length; nCount ++)
               Vector vApp = new Vector();
          vApp.addElement(asApp[nCount]);
               if(fApp.isDirectory())
                    File fAppCont = new File ("Library/components/applications/"+asApp[nCount]);
                    DefaultMutableTreeNode dmtnAppCont = new DefaultMutableTreeNode(asApp[nCount]);
                    if(fAppCont.isDirectory())
                         String[] sAppCont = fAppCont.list();
                         asbApp.append(asApp[nCount]);
                         int iRemove = asbApp.indexOf(asApp[nCount]);
                         System.out.println(iRemove);
                         asbApp.substring(0,iRemove-1);
                         System.out.println(asbApp);
                         createNodes(dmtnAppCont, sAppCont, asbApp);
                         //System.out.println("sApp: "+fApp.list()+ "sbApp: "+asbApp);
                    else if(fAppCont.isFile())
                         DefaultMutableTreeNode dmtnAppContent1 = new DefaultMutableTreeNode(fAppCont.getName());
                         dmtnAppCont.add(dmtnAppContent1);
                    admtnApp.add(dmtnAppCont);
               else if(fApp.isFile())
                    DefaultMutableTreeNode dmtnAppContent2 = new DefaultMutableTreeNode(fApp.getName());
                    admtnApp.add(dmtnAppContent2);
     public boolean checkFile(String path)
          boolean exists = (new File(path)).exists();
     if (exists)
     return true;     
     else
     return false;
     public static void main(String[] args)
          ApplicationTree app = new ApplicationTree();
}

Similar Messages

  • Getting error message for "user created how tos"  CS3

    I tried to create some new How Tos in CS3 and recieved the following error message when I try to open it:
    "The Adobe Help application could not load a URL because the specified file could not be found. You may need to re-install the application and the help component."
    If I access one of the ones created with CS2 it opens (I dragged them over from CS2, I have since removed CS2 from this computer, it's still on my laptop) I haven't tried creating them and importing them to this computer).
    I'm using Microsoft Office Word 2003 to save the How Tos as html files, and notepad to edit Add_001.howto file.
    Since I gotten this error, I reloaded CS3 Design Standard, it didn't fix the problem. Also I have ensured that the Add_001.howto file points to the right location (C:\Program Files\Adobe\Adobe Photoshop CS3\Help\additional how to content)and is in the right format:
    "John Shaws CS3" "47. A GLOSSARY OF IMAGING TERMS" 47.html (works).
    "Noise Ninja" "The Thirty Second Guide to Noise Ninja" Noise Ninja 001.html (doesn't work)
    The only thing new on the computer is a brand spanking new EVGA NVidia Geforce 9500GT PCI express(512 mb ddr2 dual DVI output) with the latest drivers. It replaced NVidia GeForce 6600GS and Matrox Millenium video cards (the Matrox). The new video card does not include some program that allows it to run MS-DOS programs, but I don't feel that is causing the problem.
    System Info:
    Photoshop CS3 10.0.1
    Computer: Gateway DX310X with Gateway FPD1975W and FPD1730 monitors
    Windows XP Media Center Edition, Service Pack 3
    Intel Pentium D proccessor
    1GB internal memory
    168GB of free space on hard drive.
    I hope I have given you suffiecient information to give me some possible solutions.
    Thanks
    Rick

    Mylenium
    Thanks for the assist.
    It isn't a Windows Indexing Service problem.
    It is an operator problem. As you pointed out the long name and spacing are the issue here.
    I changed the the Add_001.howto file from:
    "Noise Ninja" "The Thirty Second Guide to Noise Ninja" Noise Ninja 001.html
    to:
    "Noise Ninja" "The Thirty Second Guide to Noise Ninja" NN001.html
    I changed the file in the Additional How To Content folder, to match.
    And it works now.
    Now that I know what was wrong with my file names, I'll be able to get the various plugin help files/documents into Photoshop so I won't have to get out of it to get help on them.
    Thanks
    Rick

  • Version 2.0 How Tos?

    Hello,
    I'm looking for the How To examples for Version 2.0. Specifically the How to Upload and Download Files in an Application. I found the How To for version 3.0, but I'm having difficulty finding the How To for the version 2.0.
    Can anyone direct me to this How To?
    Thanks,
    Joe

    http://download.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CJAHDJDA
    FYI: Here is a link to the ApEx (HTML DB) How-To's. http://www.oracle.com/technology/products/database/application_express/html/doc.html
    Click on the "Older How-tos" link to the the older information.
    Mike

  • How tos - Multi Struts Config for ADF UIX (JDev10.1.2)

    Has anyone tried the OTN How-tos for Multi Struts Config?
    http://www.oracle.com/technology/products/jdev/howtos/10g/StrutsMultiConfigs/struts_multiconfig_howto.html
    Well I tried doing it and am facing a lot of problems.
    1. When I try to create a page in the child, it creates a duplicate page and hence two UIModels are created.
    2. Also there is an extra directory created in the common public_html folder as child1/child1.
    Could some one work that link out. I have failed to figure out what's going wrong.
    My problem doesn't end there. The link tells us that we can create multi struts app, but how do we link the pages created in these applications together?
    Regards,
    Vineet

    Goran,
    a smarter way would be to use Virtual Private
    Databases if the database is Oracle. This way you
    don't have to bother within your application to do
    this. We do have a VPD example in teh howtos for
    JDeveloper 9i.Tnx for the suggestion, but I needed a solution within ADF.
    If you want to do this on teh middle tier, use a bind
    variable in the BC query and populate this through an
    exposed method on the AM. I found even simpler solution... I let user choose an employee and fix this employee's id with a setCurrentRowWithKeyValue operation (drag-n-drop to a Data Action). Afterwards all the screens based on child view objects in the Data Control Palette hierarchy display only data from a fixed employee.

  • How-tos in graphic editing?

    I have two questions:
    1,
    I need to know how to add this kind of effect in graphic editing (i.e to  have the reflection of the object itself in the opposite direction).  see this pic
    http://jithonline.com/wp-img/DTSL1.gif
    2,
    How can I add (those smoother looking) high definition "HD" effect to an  image? I have pics taken with non HD camera, and simply want such  effect on them.
    I have Adobe CS4 Suite, and I believe the above two can be accomplished  with one or more of the applications in this suite. But just dont know  how. I'm a newbie in graphics.
    I need the very 1,2,3 basics,
    Help please!

    Thanks Scott, I will give the answer 1 a shot right away!
    On question 2,  pardon me as I'm not a pro. but a beginner. I guess what I was going to say was "image resolution"
    So what I really meant is to edit or transform an image of this level of quality (resolution)
    http://www.statesymbolsusa.org/IMAGES/Statue-of-liberty2.jpg
    to an image of this level of quality
    http://cari373.files.wordpress.com/2010/03/statue-of-liberty-address1.jpg
    I know it may not be a one-click-magic, but the very basics of what to do (in Fireworks or any other of CS4 suite) in refining an image to improve its look

  • Within CS5 (Dave Karlin) How-Tos: 'simple album' converts to Quicktime

    The training book offers foto album w/in flash as a 'simple' (to play as slideshow on devices by converting swf to Quicktime) but only 4 images per pop: I have about 100 images. 'Advanced' has no direction for the same capacity: is the 4 image limitation a QuickTime issue or is it a limitation to the Adobe software? And does the 'advanced foto album' convert to quicktime? Quicktime can be converted to play as h.264 for devices; right now, my swf (4 images: simple converted to swf) flash box doesn't play on IPhs, my roll over to enlarge gallery (swf) doesn't play on Iph: photoshop click thumbnail to enlarge isn't going to work on Iph or other cell ph devices? (not w/out a curser). I would hire a professional editor/consultant but I haven't been able to snag one (despite effort). Another person asked me why not what for? because his webdevel told him "Don't worry about the four images only; we'll fix that later." I've divided my image files into years 1999-2013: that's a lot of individual quicktime movies at only four images per movie file. And how would a slideshow be activated on an Iph (cell phone w/Inet capacity) if there
    isn't a curser?! If converting QT to h.264 does it just play all the time? I've got a lot of other videos to attempt converting, so this needs better technical skill than what I know...    

    Swf files are not editable.Whereas fla files are editable. Think of it this way. FLA files are text files that can be created with notepad, word, etc. A swf file is machine code that requires the flash player to interpret it in a browser or AIR to interpret it as an application.
    Flash professional and flash catalyst take the text and compile it as a swf file.
    Flash pro can import a swf file though and pass it along during the compile process.
    It sounds like you are already getting in way deeper than the process I mentioned. The reason for going the flash route is when you need to add code to allow that amination to do things you can  not do visually. For example adding random blured dots and move them in a random pattern to make it look like snow. Thats a great use of flash as you are letting the computer do the work for you.
    But for a simple slide show where you are showing one image after another with maybe a fade in between, flash is a bit of a side step.
    What helps with flash is as you have seen people create templates for slides shows using code. That allow others you just add the images and maybe a few features and run the compiler.
    The problem then becomes did the person creating that template do a good enough job? Did they have your best interest at heart? Yes, even flash is suseptable to coders that have alterior motives.
    As for being afraid of quicktime, why? Apple has been in business for more years than I can remember back in the 80's anyway. Quicktime is on more PC computers than I probably could count. It's definately on all Mac computers. Its required to export any video from photoshop.
    I tell you what though, because you have the state of mind of going down the flash route, I recommend that you repost  over on the flash forum(s) As they would have way more answers about flash than you would get here.
    I also beleive that Apple has their own forum for anything quicktime related, so that may quench your answers about quicktime.
    Good luck and if you have any further questions related to photoshop, feel free to post.

  • Broadcasting in NW 2004s Useful Powerpoints and How tos

    BI Broadcasting in NW2004s/BI 7.0 (NEW): Reporting & Analytics Conference: 2006 - Dr. Bjarne Berg
    http://csc-studentweb.lrc.edu/swp/Berg/articles/Reporting_Analytics_2006_Broadcasting_v10.ppt
    BW 3.5 Broadcasting (ASUG-2006): Broadcaster at International Paper, – Dr. Berg & Joyce Butler http://csc-studentweb.lrc.edu/swp/Berg/Articles/ASUG-2006-v6.ppt
    BeX Broadcaster 3.5 including BI 7.0 new features – Dr. Berg & Filip Lemmens, SAP NetWeaver conference 2006: http://csc-studentweb.lrc.edu/swp/Berg/Articles/Portals_2006_Broadcaster_v19.ppt
    SAP BeX Broadcaster in BW 3.5 - How to make it work in practice – Reporting Seminars 2005: Dr. Berg http://csc-studentweb.lrc.edu/swp/Berg/articles/broadcaster_v15.ppt
    Thanks,
    Berg
    Main site with 50+ other presentations: http://csc-studentweb.lrc.edu/swp/Berg/BB_index_main.htm

    Hello Michel,
    The exceptions will appear in ./j2ee/cluster/server0/log/defaultTrace.<#>.trc provided that the application is written to use the SAP logging API.
    Regards,
    Nathan

  • How tos check my Map status?

    I am using Nokia E66. I want to update the latest maps to my cellphone. How to I check my current maps is the latest and what country that I already had in my cellphone? What I can see now is my maps version is v2.0 w22 b04. Please help..Thanks!

    There is no link you can use. The only way to confirm unlocking is to try a SIM from a carrier other than the one your iPhone was locked to.

  • All-New SpeedGrade CS6 | Creative Week - How Tos | Adobe TV

    Dado Valentic of Mytherapy will show you how to take your productions to a new level using the latest SpeedGrade professional colour-grading software.
    http://adobe.ly/Q186Tv

    Excellent stuff. All we need now is the ability to monitor Speedgrade's output using 3rd party hardware like the AJA Kona cards. Love the Colour Chart automatic alignment feature. Very helpful for rushes transfers as well.

  • KDE SC 4.4 installation how-tos :)

    Hi,
    It looks reasonable to put similar problems into one thread (IMHO, at least ).
    My particular problem is this:
    $ sudo pacman -Sy --asdeps qt
    $ sudo pacman -Su
    :: Starting full system upgrade...
    :: Replace kdelibs-experimental with extra/kdelibs? [Y/n] y
    resolving dependencies...
    warning: provider package was selected (phonon-gstreamer provides phonon-backend)
    looking for inter-conflicts...
    error: failed to prepare transaction (could not satisfy dependencies)
    :: kde-meta-kdepim: requires kdepim-akonadiconsole
    $
    The same result with mirrors.kernel. Any ideas?

    axel668 wrote:pacman -Rc qt
    pacman -Syu
    pacman -S kde
    This one worked only too well, just as it should . Among other things I got some plasmoids from AUR killed, naturally enough, as they depend on qt. Now I can't get rid of their ghosts on my desktop. They aren't present in the 'Add Widget' dialog and they don't have working close buttons. How am I supposed to get rid of them?
    UPD:
    After a couple of reboots the offending plasmoids somehow got lost
    Last edited by Llama (2010-02-10 15:29:24)

  • How tos start workflow

    i need a goods documents abt workflow , how to start  a workflow

    Hi,
    See the links....
    Workflow
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    For examples on WorkFlow...check the below link..
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    Workflows
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://www.sapgenie.com/workflow/index.htm
    https://sapneth9.wdf.sap.corp/workflow
    http://help.sap.com/saphelp_webas620/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    Important Details - Workflow
    http://www.e-workflow.org/
    http://www.workflowing.com/id18.htm
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    /people/ginger.gatling/blog/2005/12/01/link-workflow-business-objects-to-your-collaboration-tasks
    http://help.sap.com/saphelp_nw04/helpdata/en/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm
    http://help.sap.com/saphelp_bw33/helpdata/en/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm
    http://help.sap.com/saphelp_bw31/helpdata/en/8d/25f94b454311d189430000e829fbbd/content.htm
    http://www.sap-press.com/product.cfm?account=&product=H950
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://www.sapgenie.com/workflow/index.htm
    For examples on WorkFlow...check the below link..
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    http://www.sapgenie.com/workflow/index.htm
    Rgds,
    Prakash

  • How-tos on exporting to ePub from ID CS5?

    Hi all,
    Can anyone please give me some links to material on publishing to ePub out of ID CS5?
    I'm looking to improve my efficiency, and hopefully expand my skills in what's achievable.  But all the material I've been able to find has been either for CS4, or CS5.5.  I feel like I'm falling down the gap between the two.  Even the help files from within ID CS5 now point to CS5.5-specific sites, on Adobe and elsewhere.
    Can anyone help with this, please?

    At the moment, it's just a hobby where I'm trying to grow my knowledge.  But I work from home in publishing and sub-editing, and want to broaden my skills base.
    To be blunt, I haven't looked into 5.5, because I've not long had CS5 (from before the announcement, so I don't qualify for a freebie upgrade) and the upgrade price from here in Australia is just absurd.  I don't mean to slag Adobe, because it does a lot of things really well, but its pricing outside the US just seems like naked greed.
    The "map styles to tags" feature does sound nice, but frankly it should have been there in the previous release.  Asking two lots of the extortionate upgrade fees Adobe levies outside the US for features that should have already been there seems indefensible.  On my budget, anyway, it's going to have to wait until at least CS6, when I might get a hefty enough improvement in the feature set to justify the upgrade cost.
    But I appreciate the suggestion, Bob.

  • How to set up local server to use a remote server for login authentication?

    Thank you in advance for any help you can offer.
    We are trying to set up a "sub-network" (dont' know if this is the right terminology) using a 10.4 Server OS, to manage a set of clients... the trick is that the client login/home directory information is on a different remote server, and shall remain there, for the most part.
    To make it easy to understand here's the environment:
    *Local Server:* 10.4 G4 Server Quicksilver 1G dual--we have total control of this one
    *Main/remote server:* 10.5 Xserve.. don't know which vintage--we have very very very little input on this machine.. effectively at the mercy of the sysadmin of this system who is very conservative in changing anything (hence the need for a separate server to install applications and client machine-specific profiles, etc since the Xserve admin refuses do it). This serves MacBooks/MacBookPros and few iMacs. (no Windows PC.. as that group of comptuers have their own server)
    client: ~20 eMacs/iBooks all running 10.4.
    use environment: elementary school-->very low network demand (no e-mail, just running local apps linking to server(s) for licensing and login, and some file saving small files on remote server, user preferences, etc).
    The remote server (the Xserve) has all the login authentication, as well as the home directories. every school year, the directories get updated as new students enroll and old students graduate. Currently all the clients are directly linked to the Xserve via LDAP while we bring the local server on-line.
    the local sever (our G4 Quicksilver) will have few network applications that will support the client machines. We also will be setting up computer accounts and groups for our clients so that we can properly set their environments (the Xserve admin will not do this on the Xserve, so currently all the clients are connecting to the server as a "guest computer" from what little I understand watching what was done)
    now, what is the best way to approach this type of set up with minimal "inconvenience" of the Xserve admin?
    I am pretty experienced with standalone UNIX and macOS X administration, but a novice to this whole Server and network setup thing. Any suggestions, instructions, pointers to URLs with how-tos is much appreciated. I am not afraid to use Terminal (grew up on UNIX before GUI), etc., and willing to try safe but unconventional setups if that is what's needed...
    thanks for any help!

    Oh never mind.... I figured it out myself helps to read up on the manuals. d'oh. sorry for the bandwidth waste...

  • How do I deploy my Crystal Reports webapp???

    Post Author: figue
    CA Forum: .NET
    Hi, i've developed a web application using Visual Studio .Net and using the Crystal Reports for Visual Studio 2005. I've read almost all the "how-tos" that are available on the net to solve my situation, but i couldn't manage to deploy my application.
    I have no physical access to the web server, and i cannot execute a .exe or a .msi installer (i cannot use the "merge modules" solution).The only solution i think may help me is copying the Crystal Reports dll's to my BIN folder and using those dll's instead of using the GAC references.Here's what i've done:- I copied all the dll's that I found on Program Files/Common Files/Business Objects/2.7/Managed into my app's BIN folder.- I deleted all the references to the Crystal Reports' assemblies from my solution's property pages. FIRST PROBLEM: The references were deleted, but when I closed the solution, and opened it again, all the references returned.. After trying again and again, they finally dissapeared.- I tryied to add the references to the dll's that were into my app's BIN folder, but when I browse the file, select it, and accept the dialog box, nothing happens. No reference is added into the References window.- I tryied to add the GAC references again, to return to the previous state, but it's the same, i select the reference from the GAC and when i accept the dialog box, nothing happens.- I thought that maybe my pc has some troubles with the installed versions of crystal reports (i hace 8.5, XI and CR for VS 2005 installed), so i created a Virtual Machine, Installed VS 2005 and created a new web application with one .aspx and one .rpt and tryied to change the GAC's references for the BIN's DLLs. The same thing happend.
    Can somebody please help me? I'm gettin' really tired of trying and trying things and not gettin' in solved.
    Regards from Argentina

    Post Author: Ted Ueda
    CA Forum: .NET
    Unfortunately, xcopy deployments of Crystal Reports .NET assemblies won't work, since they rely on some dll's via COM-Interop.
    Those components have to be registered on the server - via merge modules install - and regretably, you're restricted from doing so.
    Sincerely,
    Ted Ueda

  • Connecting a Macbook Pro to a Samsung LCD TV. Can anyone tell me where to find information on what I need and how to do it?

    I want to connect my 2009 Macbook Pro to my Samsung LCD TV. I am afraid to go somewhere and ask and get bogus information so am putting it out here to see if anyone can help with the how tos and the types of cords/adapters I might need to purchase.

    You might profit from a visit to a Minneapolis Apple store. With a brand new Mac, I think they will be most helpful - not just with transferring files, but with other advice as well. And I strongly recommend you invest in a back up drive. The Apple folk can help with that as well.

Maybe you are looking for