How can I store a File object into a Vector and get it back

hi there
I need to store a number of File object into a Vector first, and later on I need to get each File object out and work with it.
Vector mylist;
File[] myfile;
....get a list of files from using File Chooser
mylist = new Vetor();
for (i=0;i<myfile.length;i++){
mylist.add(myfile);
..how do I get them back? i try to do this way
for (i=0;i<mylist.size(); i++)
File tempfile = mylist.get(i);
..work with tempfile. but I got java.lang.object error: imcompatible types. what can I do?

Vector mylist;
File[] myfile;
....get a list of files from using File Chooser
mylist = new Vetor();
for (i=0;i<myfile.length;i++){
mylist.add(myfile);
ok try this: i don't reall understand what your trying to do though...
File[] files;
// get files
Vector fileList = new Vector();
for (int i = 0; i < files.length; i++)
  fileList.add(files);
// to get them out.
for (int i = 0; i < fileList.size(); i++)
((File)fileList.elementAt(i)).toString();
// or
// to get them out.
for (int i = 0; i < fileList.size(); i++)
File temp = (File)fileList.elementAt(i);
System.out.println(temp.toString);

Similar Messages

  • How can we create a ABAP object into .ptr file

    HI,
          How can we create a ABAP object into .ptr/.car/.sar format so that we can give it to a remote client and which can be imported into their R/3 system to get the functionality of this object.

    Hello Ramesh
    All you need is SAPLINK. Have a look at the following links:
    <a href="/people/ed.herrmann/blog/2005/11/14/the-enterprise-and-the-bazaar Enterprise and the Bazaar</a>
    <a href="https://sourceforge.net/projects/saplink/">SAPLINK</a>
    Regards
      Uwe

  • How can i call this file path into my bsp-html  to display the images?

    Hi
    I have a file path for an image like c:/test_logo.bmp.
    How can i call this file path into my bsp-html  to display the images?
    moosa

    Try this...
    Can i have  sample code in BSP-HTML to display images?

  • How can I pass a file refnum into and out of external c++ code? What type does it convert to in c++?

    I am trying to write external c++ code that will read a file already opened by Labview and therefore assigned a refnum. (Unfortunately, I definately can't use the standard Labview vis.) However I am not sure what c++ type to use in order to manage the refnum.
    All help and thoughts appreciated. Thanks,
    Joanna

    You could do ALL your file handling in C or C++ (MFC CFile for
    example) and pass Microsoft file handles into and out of LabVIEW
    instead of LabVIEW file references into and out of C. This may be an
    easier way to attack the problem.
    You could create a DLL in MSVC that exports a FileOpen function, a
    FileClose function and a FileRead and/or FileWrite Function and then
    call that DLL from place to place as required in your code.
    It would help us if you would explain what kind of data you are trying
    to read or write and what the application is. Is it binary data?
    text files? Do you need some special Win32 file system feature like
    file mapped memory? I guess what I am asking is what is your
    motivation for doing file handling in C or C++?
    Douglas De Clue
    LabVIEW developer
    [email protected]
    "Rolf" wrote in message news:...
    > A LabVIEW file refnum is an internal Magic Cookie to LabVIEW and there is no
    > way to directly extract the actual information assigned to that Magic
    > Cookie.
    > However the CIN Reference Manual describes one function which allows to
    > retrieve a lower level "File" handle and at least on Windows 32 bit and
    > LabVIEW
    > from version 5 up to and including 6.1 this "File" LabVIEW datatype directly
    > maps
    > to the Win32 API "FILE" Handle.
    >
    > The function to use is
    >
    > MgErr FRefNumToFD(LVRefNum refNum, File *fdp);
    >
    > It is declared in extcode.h or one of its dependant headers and exported
    > from "labview.lib"
    > all located in the cintools directory and you can link this lib also to a
    > normal DLL project.
    > However calling this DLL then from any other process than LabVIEW or a
    > LabVIEW
    > executable will not initialize the DLL anymore correctly.
    >
    > Your best option if you need to write in C(++) should be to use the LabVIEW
    > file manager
    > functions described on the External Code Manual (manual/lvexcode.pdf) on
    > this File handle.
    > If you need to use directly some Win32 API functions with it please note
    > that although currently
    > the "File" in the LabVIEW file manager functions matches the FILE in Windows
    > 32 bit API
    > functions this is an undocumented and hence unsupported feature. The next
    > LabVIEW version
    > may actually use a different datatype for its "File" parameter to the
    > LabVIEW file manager calls
    > and your use of assuming File == FILE may simply crash.
    >
    > Also operating on a file refnum in LabVIEW which has been accessed directly
    > with Win API
    > functions may result in strange behaviour such as the file read/write mark
    > not being updated as
    > you would maybe expect it.
    >
    > "Jo" wrote in message
    > news:50650000000800000016520000-1023576873000@exch​ange.ni.com...
    > > How can I pass a file refnum into and out of external c++ code? What
    > > type does it convert to in c++?
    > >
    > > I am trying to write external c++ code that will read a file already
    > > opened by Labview and therefore assigned a refnum. (Unfortunately, I
    > > definately can't use the standard Labview vis.) However I am not sure
    > > what c++ type to use in order to manage the refnum.
    > > All help and thoughts appreciated. Thanks,
    > > Joanna

  • How can i type international alphabet characters into keywords, title, and captions in Lightroom 4?

    How can i type international alphabet characters into keywords, titles, and Captions in Lightroom 4?  Usual Microsoft key shortcuts not working.

    I haven't found a way to do that directly, but there is a workaround. It' s a bit cumbersome, so it's only good for the occasional character.
    In MS Word or any other text editor create a file that contains all the international characters you need.
    When you need to insert one of these characters into Lr (captions, title, keywords) copy the character from your text document and paste it into Lr where needed.
    On Windows Ctrl + C / V works fine.

  • How can I split my Dj mix into separate tracks and export the tracks

    How can I split my Dj mix into separate tracks and export the tracks. I'm trying to burn my Dj mix to cd and I don't want it to be one long track.

    Henryfrommo wrote:
    How can I split my Dj mix into separate tracks and export the tracks.
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportsections
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • My laptop died so I've installed itunes onto another PC and my music is all on an external hardive which is connected to the new PC. How can I sync my ipod with the new itunes and get all the music onto itunes?

    My laptop died so I've installed itunes onto another PC and my music is all on an external hardive which is connected to the new PC. How can I sync my ipod with the new itunes and get all the music onto itunes?

    You might consider itunes match for moving CDs you've copied into your itunes library if you dont have a way to use home sharing.
    iTunes match is an optional service offered by apple that costs about $25 a year.  It scans your music library and if it finds music that is already in apple's itunes catalog it'll automatically "unlock"/"store" these in the cloud for you.  Items that it does not find in the catalog it'll upload and store these in the cloud for you and you can download them on your devices.  See http://www.apple.com/itunes/itunes-match/

  • How can I cancel the storage plan I just bought and get a bigger plan?

    How can I cancel the storage plan I just bought and get a bigger plan?

    I quote:
    'If you purchase a higher-tier storage plan for your iCloud account to replace your existing storage plan (for example, a 20 GB plan to replace a 10 GB plan), the existing plan will be canceled and you will receive a prorated refund for the time remaining. The new storage plan is applied to your iCloud account and the annual payment date is updated to reflect the purchase date for the new plan.'
    So just purchase the new storage level and it will sort itself out automatically.

  • How can i store jpeg file in iCloud?

    I want to upload jpeg file in iCloud, so that I could insert it to my document later with Pages. but can't find how can i store this type of file in icloud....

    iCloud isn't really meant for that purpose, more for syncing across devices. Try something like dropbox.

  • How can I store iPhoto files on an external hard drive rather than on the iMac drive

    How can I store my iPhoto library on an external hard drive rather than the iMac drive to make my computer faster?

    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • How can I import mpeg files downloaded into itunes?

    How can I import mpeg song files downloaded into itunes?

    Where are your MPEG stored?
    I have hundreds of old MPEGs stored in my nexternal drive, but unfortunatly i was not able import them into iMovie. I did the following trick: I created a new set of a folder and subfolder and called it "Virtual_CAM/DCIM" and saved it on my desktop. Then went to Disk Utilities>File Menue>New>Disk Image from Folder. Then selected the folder on my desktop and clicked enter. I moved the .dmg file to my external (or just keep it on your desktop). I clicked on the .dmg file. It shoud be visible on the Finder. Open your Imovie and import as you do from your camera.

  • How can I store .jpeg files in Oracle ?

    Hello All,
    I'd like to store .jpeg picture images in my database having 2 columns - model_no and model_pic1.
    I know that I've got to use LONG RAW datatype for binary large objects... Don't know anything more...
    Would be pleased if anyone help me in doing this.
    Thanking you,
    Plascio

    For PDFs, it's better to use Dropbox instead of icloud.
    If you want to use icloud, you'd have to use itunes's app tab and drag the pdf file to the right panel after highlighting iBooks.  A pain. 
    For Dropbox: On the iOS device, use GoodReader to access the file(s).
    If you are just trying to store a pdf on icloud as storage, than getting the pdf to icloud and then back to your mac involves drag and drop both ways using itunes.  Again, use Dropbox instead.

  • How can I burn a Motion Video into a dvd and keep the same quality?

    I tried exporting my Motion video into Quick time but the quality is horrible. The images and text are blurry.
    How can I export this video into a DVD or CD and keeping the best quality of the video?
    Would Appreciate someones help.
    Thank you

    Try this - export the Motion file as an animation and import into FCP - then apply color correction, if necessary. Then push it through Compressor and onto DVD.....
    Hope that helps.

  • I bought a used i pod 4 for my daughter and it does not have the message icon on it: how can i put the icon on the i pod and get it receive and send messages

    I bought a used i pod 4 for my daughter and it does not have the message icon on it ( not even in settings) how can I get the message icon on it so it can receive and send messages

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:       
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • HT1212 Question??? My daughter has her old ipone 4 that she cannot remember the passcode to unlock it and retrieve her information to put on her new iphone 5..how can we find out her password to remove it and get her information

    My daughter has an old iphone4 that she can not remember the passcode to get into it and retrieve information for her iphone5...how can I restore the phone or get the password off w/o knowing current passcode?

    There is no way to retrieve any data from the phone unless you can remember the passcode. That's the whole point of the passcode, to protect the data. To remove the passcode, you'll have to force the phone into recovery mode, as described here, & restore it:
    http://support.apple.com/kb/HT1808
    All data on the phone will be erased.

Maybe you are looking for

  • Tv wont recognize mini DVI to VGA cable

    Okay so I have a mid 2012 Macbook Pro with the Intel 4000 graphics card. I also had a Mini DVI to VGA cable from my previous macbook. I plugged it into my new macbook hooked a VGA cable to my Panisonic LED, but my TV wont recongize my computer. It wo

  • T.code for GL Open Items clearing

    Hi all,, Can anyone give the the tcode for clearing the Open items of a GL which is maintained in OIM...!? BR..AJ

  • EXIT_SAPLATPC_002 / AVAILABILITY_CHECK_CONTROLLER

    I want to use user exit "EXIT_SAPLATPC_002" (include ZXATPU02) to ensure that the number of sales units is a multiple of the delivery unit to avoid broken boxes. However, I find that once the code has run in "AVAILABILITY_CHECK_CONTROLLER" the result

  • Messeges bloked in queue

    Hi All, The messages are stuck up in queue ,if we check in queue the STATUS is *_connection closed and no data _

  • Update new version of Firefox but old version of Mac OSx. Now all old bookmarks lost.

    I made a mistake: I download the last version of Firefox but my laptop (an iBook with Mac OS 10.4.11) does not support this Firefox version. Now I lost all my bookmarks because the new Firefox version delate the old one. Is it possible to recover the