Can I play files from a folder

Sorry about the last message.
Want Im asking, can I setup a media play that reads all the file in the directory "." in the prog below, without setting the full path of each file.
I can make a file list, but not sure about making a a player auto read the directory in sits in. I don't want a file chosser.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
class Test1Candelete2 extends JFrame
  DefaultListModel dim = new DefaultListModel();
  JList list = new JList(dim);
  public Test1Candelete2()
    setLocation(200,100);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    JScrollPane sp = new JScrollPane(list);
    sp.setPreferredSize(new Dimension(150,200));
    File directory = new File(".");
    File[] files = directory.listFiles();
    for(int x = 0; x < files.length; x++)
      if(files[x].isFile()) dim.addElement(files[x].getName());
    JPanel panel = new JPanel();
    JButton btn = new JButton("Delete File");
    panel.add(btn);
    getContentPane().add(sp,BorderLayout.CENTER);
    getContentPane().add(panel,BorderLayout.SOUTH);
    pack();
    btn.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent ae){
        int selectedIndex = list.getSelectedIndex();
        if(selectedIndex < 0)
          JOptionPane.showMessageDialog(null,"Please select file to delete");
        else
          File fileToDelete = new File((String)list.getSelectedValue());
          if(fileToDelete.delete()) dim.removeElementAt(selectedIndex);
  public static void main(String[] args){new Test1Candelete().setVisible(true);}
}

Thanks for your reply:
I did find an error log related to the error code and tried all suggestions on the list of recommendations, still no luck            
I definitely am running OS X10.5.8 (hopefully will be updating later on this month)
I tried several brand new discs from the same box, still no luck.
My last option is to go out and try a different brand, guess I'll go with Verbatim this time but I think I'll poke around some more before buying 20 more new discs.

Similar Messages

  • I suddenly can't move files from one folder to another in my FlashHelp project.

    I have RH8 (8.02). I have been working on this project for a couple of years now.
    What changed? I had imported a Word document and then removed the document and the folder it created from the Project Manager. Now I cannot move any of my files from one folder to another in the Project Manager pod. I susptected a corrupt CPD file so I closed the project, deleted the CPD file. Next I opened Robo from Programes (I never open from the .xpj file), went to Tools>Options and deleted the pinned most recently used project. Select Open, and locate/open the xpj file. I've also re-generated the output (no errors) and completed all these steps again. Of course Robo only goes haywire on me right before I have to publish for our new software release.

    Hi there
    From what I'm seeing my own guess here is that RoboHelp is still believing that the content belongs to word.
    I might suggest the following steps.
    Open Winows Explorer and make copies of the HTML files involved. Then from RoboHelp, delete or remove the content. Then use the Import function to add the desired HTML files back into the project into the desired folder.
    My thought is that by taking these steps you will have effectively disassociated Word and the topics should now be independent topics that RoboHelp should allow you to manage as you wish.
    Hope you get it sorted... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Can't copy file from Shared Folder

    Hi,
    Does anyone here knows how to copy file from shared music. I can view others shared music but can't do anything about it. When I tried to Right Click on music I want to copy. There are only 3 options (Get info, Unchecked Selection & Copy). I chose copy, but don't know what to do next. I wanted to place it in my Library but don't have an option to do it.
    Please help.
    Thanks,
    guadz

    I've never copied music, but have you tried just dragging the file to your library? Not 100% sure if it works, never tried it myself. Also, if you right click in your library, can you paste?

  • Can't drag files from Assets folder to bin

    I have the free trial; 8.1 - running a Mac OS X 10.9.5
    I'm on the second video of the tutorial. I cannot get any of the files - jpg or mp4 - to drag into the Footage or Stills folder.
    This very simple, basic move is keeping me from going forward in the Tutorial - disappointing.
    Thanks anyone for help.

    Mystery solved, at least partially. On the folder that the dashed line points to, The magnifying glass icon indicates that it's a "search bin." That type of bin was added in version 2014.1 (October 2014). Search bins show only project items matching your search criteria--things like a string of letters in the name, the asset type, or metadata like frame rate. Since these special bins are populated by the program based on the search criteria, so you cannot manually add anything to such a bin. To learn more about search bins, please see this page in the help: Adobe Premiere Pro Help | Finding assets
    The remaining part of the mystery is where those two search bins came from. But for your immediate purposes that's moot. It appears that what you need at the moment is a new Stills bin, which you can create by clicking the New Bin button in the bottom right corner of the Project panel.

  • I am not being able to play sound when I import a .MTS file from my folder

    I am not being able to play sound when I import a .MTS file from my folder on my sequence bar of my Premiere Pro CS6. Even if I use my Media Browser to import the file, the video plays fine, but the audio is disabled it seems. I don't know what to do since I have used .MTS files before without hassle on CS5.5. It is quite frustrating. What can I do?

    Hi debesh05,
    Please mention the Operating System that you are using and also make and model of the Camera that was used to capture those clips. Also, try to make another folder with the same name in the same location where the .MTS files are and move all the clips into the new folder and then try to import the files again using Media Browser in Premiere Pro CS6. If this doesn't work then make a copy of one file and rename it as .M2TS and then import that single file into Premiere Pro CS6. Please update if either of the solution works for you.
    Regards,
    Vinay

  • Can't drop files from Downloads or Documents folder on the dock to any other Finder window

    I have been downloading some files and dragging/dropping them into another folder for the last 30 minutes or so. They're downloading to the default Downloads folder, and then I've been dragging them from that folder in the Dock, which opens like a fan, and dropping them into another folder (my Documents folder) in an open Finder window.
    All of a sudden, I can't drop files from the Downloads fan anywhere else. I also tested, and can't drop files from my Documents folder or my Screenshots folder, two other folders that are on the right side of my dock and open up like a fan.
    I can drag them, but when I hover over the folder that I want to drop them into, nothing happens. If I let go, they just stay in their original folder (the Downloads folder).
    So basically something happened with the folders on the right side of the dock that's not letting me drop the files anywhere else from the Dock. If I open the folders in their own Finder window, I can drag/drop just fine. It just won't let me do it from the Dock as I had been.
    Any ideas? I've tried restarting as well as sleeping/waking as I saw recommended on here, but no luck.

    Open Finder, press Option key, select Go > Library, open Preferences, delete com.apple.dock.plist and reboot

  • How can I move a Pages file from a folder to another one?

    I Have done the upgrade to mac os Yosemite but now i'm Not able to move a file from a folder to another one Inside iCloud
    now it's impossible to organize MY archive

    Thankyou Winston, you guess right. What i don't understand is why with the older version of mac os (10.9) i can organize my document into icloud folders using the Pages app window. But now with the new version i'm no longer able to do that. Using ipad in the same window there is no problem, but in mac os it doesn't work. 

  • How can I bring a file from a folder on my desktop to this program and make it editable. Like deleti

    How can I bring a file from a folder on my desk top int this program and make it editable., in order to replace words or remove words or texts..?  jn

    Hi,
    FormsCentral cannot be used to edit existing PDF documents. That functionality is available in Adobe Acrobat:
    http://www.adobe.com/products/acrobat.html
    Regards,
    Brian

  • I have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk?

    i have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk through disk utilities without erasing data (but will it delete my programs such as photoshop, office, creative suite?

    Connect the computer to another Mac and put it in FireWire Target Disk mode, or use the Disk Utility to clone the drive or image specific folders with the USB drive as the target. After you've copied off everything you want, you'll likely need to erase the drive and reinstall the applications.
    (69695)

  • Why can't i move files from one folder to another by sliding them?

    help. i am trying to move files from one folder to another. but i cant slide them by clicking on a file and sliding it to another place. any suggestions? thank

    Go to Finder "Go" menu hold the option key and choose Library. Then go to Preferences trash these files:
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then, restart, or log out and in again.
    (You will have to reset a few finder prefs the way you like them.)

  • Importing All the files from a folder at a time

    Hi....
    Can any body tell me how to import set of files from a folder into IDM.
    It is becoming very difficult to import the files one after other....
    Waiting for Reply....
    Thanks in advance..........

    We used an ant script to build an XML file that will contain the files. The script is configured to use the folder structure of our CVS repository.
    We'd checkout our XML module and then run the build script and import the resulting init file.
    Code to the script is below -- caveat emptor. You'll need to change the folder structure to suit your own environment.
    <?xml version="1.0" encoding="UTF-8"?>
    <project basedir="." default="all" name="MyInit">
        <target name="init">
            <property location="." name="src.dir"/>
            <property location="." name="dest.dir"/>       
            <property name="project.name" value="${ant.project.name}"/>
            <property location="${dest.dir}/MyInit.xml" name="MyInit.output"/>
            <property name="source.configuration" value="${dest.dir}/configuration"/>       
            <property name="source.emailTemplate" value="${dest.dir}/emailTemplate"/>
            <property name="source.forms" value="${dest.dir}/forms"/>
            <property name="source.reports" value="${dest.dir}/reports"/>               
            <property name="source.resource" value="${dest.dir}/resource"/>          
            <property name="source.rules" value="${dest.dir}/rules"/>
            <property name="source.workflow" value="${dest.dir}/workflow"/>
            <!-- get the source path -->
            <path id="configuration.path">
                <fileset dir="${source.configuration}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="cp" refid="configuration.path" />
             <path id="emailTemplate.path">
                <fileset dir="${source.emailTemplate}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="ep" refid="emailTemplate.path" />
             <path id="forms.path">
                <fileset dir="${source.forms}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="fp" refid="forms.path" />
            <path id="reports.path">
                <fileset dir="${source.reports}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rptp" refid="reports.path" />                 
            <path id="resource.path">
                <fileset dir="${source.resource}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rep" refid="resource.path" />        
            <path id="rules.path">
                <fileset dir="${source.rules}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rp" refid="rules.path" />
            <path id="workflow.path">
                <fileset dir="${source.workflow}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="wp" refid="workflow.path" />
            <!-- get the path prefix -->
             <path id="source.path">
                <pathelement location="${src.dir}" />
             </path>
             <property name="sp" refid="source.path" />       
        </target>
        <target depends="init"  name="win_init">
            <!-- change the path of xml files to windows path -->
            <property name="importfile.path" value="${sp}"/>                            
        </target>              
        <target depends="init" name="make">
        <!-- using XML character entity references to escape
        <  <
        >  >
        '  &apos;      -->    
            <echo file="${MyInit.output}" append="false"><?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE Waveset PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <Waveset>
    ${cp}
    ${ep}
    ${fp}
    ${rptp}
    ${rp}
    ${wp}
    </Waveset>
            </echo>
         <!-- replace path prefix with ImportCommand -->
         <replace file="${MyInit.output}"
                  token = "${sp}"
                  value = "<ImportCommand name='include' file='${importfile.path}" />
         <!-- deal with file and path separators in an os independent way -->
         <replace file="${MyInit.output}"
                  token = "${file.separator}"
                  value = "/" />        
        <replace file="${MyInit.output}"
                  token = "${path.separator}"
                  value = "${line.separator}" />
        <replace file="${MyInit.output}"
                  token = ".xml"
                  value = ".xml'/>" />
        </target>
        <target depends="init,win_init,clean,make" description="Build everything." name="all"/>
        <target depends="init" description="Clean all build products." name="clean">
            <delete file="${MyInit.output}"/>
        </target>
    </project>

  • Can't copy files from mounted DMG. What's up??

    So all of a sudden, I can't copy files from mounted DMG files. It's strange because if there is one file and I drag it to another location, like desktop, it won't copy. If I drag 2 files from the mounted DMG to the desktop one of them copies. If I drag 3, then 2 copy... it's always all but one of the files... never all of them.
    I've tried repairing permissions but nothing works. I'm at a loss...
    thanks
    D
    iMac Core Duo 17", 1.5 gig RAM   Mac OS X (10.4.8)  

    Try holding option when you drag the files. This tells the mac to move the files to the desktop of your computer not the desktop folder of the DMG (usually a hidden folder)
    If that doesn't work it may be that you need administrative privileges to move the files. Make sure you are logged on as as an administrator by selecting the account tab in system preferences and making sure it says "admin" under your user name. Log on to or create an administration account then try moving the file.
    Hope this helps, let me know
    Thom

  • Is it possible to pickup a specific file from a folder?

    Hi
    I am wondering whether it is possible to pick a specific file from a folder. I have a shape where I have got a filename and I need to look for it in a folder.
    Is that possible?
    And how can I achieve this? The next step is to pick the file up and transfer it to another location. So basically in pseudo code I need to ask my defined folder with a filename as parameter. Get the file and move it to another folder.
    Suggestions are most appreciated. Thanks

    Assuming you are using orchestration, you could
    create an assembly, install it in the GAC, add a reference to it in your BTS
    project, and call it from an Expression shape to resolve the receive
    location. You would only really need one static method in a class. Be sure
    to add a reference to Microsoft.BizTalk.ExplorerOM.dll.
    Example:
    using Microsoft.BizTalk.ExplorerOM;
    namespace Phil
    public class OrchestrationHelpers
    public static string ResolveReceiveLocationName(string
    inboundTransportLocation, string receivePortName)
    BtsCatalogExplorer bts = new BtsCatalogExplorer();
    bts.ConnectionString =
    "SERVER=localhost;DATABASE=BizTalkMgmtDb;Trusted_Connection=True;Network
    Library=DBMSSOCN;"
    foreach (ReceiveLocation location in
    bts.ReceivePorts[receivePortName].ReceiveLocations)
    if (location.Address == inboundTransportLocation) return location.Name;
    return null;
    In your Expression shape within your orchestration, assuming a message
    called "MyMessage" and a string variable "receiveLocationName":
    receiveLocationName =
    Phil.OrchestrationHelpers.ResolveReceiveLocationName(MyMessage(BTS.InboundTransportLocation),
    MyMessage(BTS.ReceivePortName));
    If this post answers your question, please mark it as such. If this post is helpful, click 'Vote as helpful'.

  • When importing a file from a folder

    when importing a file from a folder it appears in the organizer as a exclamation mark but no photo. can anyone help i use elements 9

    Hi there,
    Digging up an old thread slightly, but is this still definitely the case? Last week double-clicking a folder definitely just opened up a folder for me to explore its contents, but now I'm constantly accidentally importing huge folders into things like After Effects and Mail... it's very annoying!
    If there's a fix I'd love to hear it!

  • Reading a file from a folder.

    Hi everyone,
    I am trying to modify my first java program.
    The method below is used to read a file that is hard coded in the below method. What I would like it to do is to pick up files that are stored in a folder. The reason for this is that the file names will never be the same.
    I am unsure how to do this and would appreciate some help from you.
    Thanks in advance.
    public void fileBreakdown()
              try
                   FileReader file = new FileReader("files/myTextFile.txt");
                   BufferedReader buffer = new BufferedReader(file);
                   String textline = null;
                   ArrayList arr =  new ArrayList();
                   while ((textline = buffer.readLine()) != null)
                        boolean syswarnEndFound = false;
                        if((textline.substring(45, 52)).equals("SYSWARN"))
                             System.out.println(textline.substring(45, 52));
                             arr.add(textline);
                             while ((textline = buffer.readLine()) != null && !syswarnEndFound)
                                  if(textline.indexOf("}") == -1)
                                       //System.out.println("not found : " + textline);
                                       buffer.mark(1000);
                                       arr.add(textline);
                                  else
                                       //System.out.println("found");
                                       syswarnEndFound = true;
                                       buffer.reset();
                                       OutputFileTypes.processSYSWARN(arr);
                        else if((textline.substring(45, 51)).equals("SYSMSG"))
                             System.out.println("Stopped, program ends");
                             System.out.println(textline.substring(45, 51));
                             arr.add(textline);
                             while ((textline = buffer.readLine()) != null && !syswarnEndFound)
                                  if(textline.indexOf("}") == -1)
                                       buffer.mark(1000);
                                       arr.add(textline);
                                  else
                                       syswarnEndFound = true;
                                       buffer.reset();
                                       OutputFileTypes.processSYSMSG(arr);
                        else
                             String[] messageArr = textline.split(" ");
                             Processing.whichFileType(getSubject(messageArr),getMessage(messageArr),getPublishedDate(messageArr));
                             getPublishedDate(messageArr);
                   buffer.close();
              catch( IOException e) {System.out.println(e);}
         }

    I could not compile your code. But if you wanted to get all .txt files from a folder then you could do something like this
    class EndsWith implements FilenameFilter {
         String ext;
         public EndsWith(String ext) {
              this.ext = "." + ext;
         public boolean accept(File dir, String name) {
              return name.endsWith(ext);
         public static void main(String args[]) {
              String srcDir="C:/temp/";
              try {
                   File srcFiles = new File(srcDir);
                  FilenameFilter filteredFiles = new EndsWith("txt");
                  String sourceDir[]=srcFiles.list(filteredFiles);
                  for(int i=0;i<sourceDir.length;i++)
                       String fileName = srcDir+sourceDir;
              System.out.println(fileName);
              FileReader file = new FileReader(fileName);
              //..your code here
              }catch(IOException ioe) {
                   ioe.printStackTrace();
    NOTE: I haven't tested this code. You can give a try.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • How to replace a table name with an item value in report region SQL query?

    I've got a SQL query in a report region that goes like this: SELECT :P30_HIDDEN FROM v_dms_dataset GROUP BY :P30_HIDDEN P30_HIDDEN is populated from a textfield input. Why doesn't this work, and is there a way to achieve what I'm trying to do here? I

  • IPhoto Rotating Imported Pictures Randomly

    Hey, Ive been having this problem for a while through multiple Mac OS updates/Phone updates.  I've got a 2008 Macbook Pro (Ancient I know) and an IPhone 5.  It is running the latest Mavericks OS and the phone is up to date.  Anyway, it always seems t

  • Splitting a long list of checkboxes

    Hello i have made a list of checkboxes, based on a LOV. Is it possible to split the long list(70 boxes) into different columns? My last solution is to make i static, but that is something i hope to get around.

  • Fire fox is not repsonding?

    Web site informed me that there was an update available and I clicked ok in order to update, ever since when I try to open fire fox the message says ""your computer must be restarted to complete a previous upgrade of firefox. do you want to reboot no

  • Maxtor bridge chip: ICH5R vs. Promise

    I recently encountered some problems with my Maxtor SATA drive. Benchmarking my system with 3D Mark always led to a crash (system hanged). Also defragging the drive with Norton sometimes led to equal problems. Every time the harddrive led would stay