Saving file.. with txt extention and more...urgent..

if (e.getSource()==save)
          FileDialog fd =new FileDialog(this,"Save",FileDialog.SAVE);
               fd.show(true);
               String fileName = fd.getFile();
                 String directory = fd.getDirectory();
                 if (fileName != null)
                      try
                      File file = new File(directory, fileName);
                      PrintWriter out = new PrintWriter(new FileWriter(file));
                         out.println(date.getText());
                        out.println(request.getText());
                        out.println(byteSent.getText());
                        out.close();
                   catch(IOException er )
         }look at the code above..
it saves all the values of the textArea in bunch.. and does not display a extention..
what i want is when a user clicks the save button. it should display the save dialog with the .txt extention ...
then it shoud save the
date Request byteSent
1792 12 1012222 //new line in the txt file.
1980 13 32131223 //new line in the txt file
format in the txt file... i guess you got a idea? please hlp? thanx..very

SIGH
Continued from:
http://forum.java.sun.com/thread.jspa?threadID=619387
Dag-nabbit crossposters!

Similar Messages

  • File with exlamation point and more....

    I just recieved a used ipod from my friend a couple of days ago, it was working and he was listening to it and everything and now all it does is restart when ever you move it, i dont even have to touch any of the buttons and it just comes up with the apple logo. Following the apple logo i get the stupid file with the exclamation point, i have tried connecting it to my computer but my computer will not recognize it. I have windows XP and i dont have the disc that came with the ipod because my friend had had the ipod for a long time and had already thrown it away. Im trying to give this ipod to another friend for her birthday and really need to fix my problem fast and nothing seems to work. Its a fifth generation ipod and when i go to charge it it doesn't even show that its charging what do i do?

    See these.
    iPod shows a folder icon with exclamation point after disconnecting.
    iPod shows a folder icon with exclamation point when you turn it on.

  • Opening a file with custom FileDialog. (VERY URGENT)

    hi everybody,
    I have a problem and stuck. I have developed a MDI application that provides all function like open saved files, create new, edit and lots of other. It only opens, save ,edit etc the graphical diagrams inside JInternalFrames. I have an icon on my desktop when clicked opens this Application. Just like Editplus, Word or some other application when you click on the icon it opens that. Same way I have created such functionality.
    Now instead of this I have created a custom FileDialogfrom which the user selects this application and is opened. Now I have small icon for this FileDialog on the desktop when opened gives the interface to select the files to be opened. My FileDialog just looks like the FileDialog but some more functionality and more components like JComboBox, Jlist, JtextField, JButtons etc. in it and have removed some of them. I am extending JDialog. But now my probelm is when you select a file and click open, it should open the selected file. How can I achive this functionality in my custom FileDialog as I am not extending FileDialog and as it is built in the FileDialog. How can I open the files with any extension in it's related application e.g .doc files to be opened in MicrosoftWord, .txt to be opened in notepad, .c or .cpp in Visual Studio C++ etc.
    How can I put this kind of functionality in my custom FileDialog. It's really important for me please any comments will help me alot. Thanks for the help

    Hello,
    I think you can write :
    Runtime.getRuntime().exec("start.exe " + MyFileDialog.getDirectory() + MyFileDialog.getFile());
    So, "start.exe" choose the application (not valid for NT machine), ".getDirectory()" return the PATH and ".getFile()" return the NAME.
    Best regards from France
    Thierry

  • Importing CD to Artist folder\Album folder\file with track number and name:

    I have a problem then importing my cd’s to my harddisk using iTunes.
    On my previous pc I got what I want, Artist folder, Album folder and file with track number and name:
    e.g.
    D:\My Music\B.B. King\Blues On The Bayou\01 Blues Boys Tune.mp3
    D:\My Music\B.B. King\Blues On The Bayou\02 Bad Case Of Love.mp3
    D:\My Music\B.B. King\Blues On The Bayou\03 I'll Survive.mp3
    But now I get:
    D:\My Music\Compilations\Blues On The Bayou\01 Blues Boys Tune.mp3
    D:\My Music\ Compilations \02 Bad Case Of Love.mp3
    D:\My Music\ Compilations \03 I'll Survive.mp3
    In iTunes my settings are Edit -> Preferences -> Advanced: iTunes Music folder: D:\My Music and checkmark in both: “Keep iTunes Music folder organized” and “Copy files to iTunes Music folder when adding to library”.
    My version of iTunes is 8.0.1.11
    Thanks in advance
    Peter

    It will depend on the album. Gracenote considers anthologies, a collection of tracks by the same artist taken from different albums, as a compilation. In iTunes the compliation setting should really only be applied to a collection of tracks by different artists.
    tt2

  • In Photoshop Elements 12, is there a way to batch process all photos in a file with 'Auto Tone' and save the changes?

    In Photoshop Elements 12, is there a way to batch process all photos in a file with 'Auto Tone' and save the changes?

    Thank you, that was perfect!
    Yoni

  • "File with specified name and version number already exists. Result code= -48."   ...????

    Recently I have been getting this error message when I try to record an audio track in Logic... "File with specified name and version number already exists. Result code = -48."  WHAT IS THE PROBLEM?????? It's making me furious!

    Hi
    As the message says, there is a file at the recording directory that has the same name:
    http://support.apple.com/kb/ht1618
    Try changing the name of the track (this sets the filename in later versions of Logic 9
    CCT

  • Ok.  I hope someone can answer my question.  I am new to photoshop.  I need version cs4 in order to work with a designer and printer on some logo work. I've tried to download it but it just gives me individual files with no installer and nothing - includi

    ok.  I hope someone can answer my question.  I am new to photoshop.  I need version cs4 in order to work with a designer and printer on some logo work. I've tried to download it but it just gives me individual files with no installer and nothing - including the adobe "instructions" seems to work.  How can i get this software in a downloadable format? is it actually free - I'm assuming it is...  Hope someone knows the answer to these questions...

    The download itself is free and is valid for 30 days only.  After that, the software ceases to work.
    CS4 is pretty old, no longer sold and no longer supported by Adobe.  It's also not compatible with many modern OSes.
    Why do you have to work with such an obsolete version of Photoshop?
    What kind of "designer" uses it?

  • Downloading .xls file with multiple rows and Columns

    Hi ALL,
    I need to genarate .xls file with multiple rows and and Columns and sent as an email.Since our customer having Problem with .CSV files need to genarate .XLS file.
    Please do the needful.
    Thanks
    Madhu

    Hi Madhu,
    You might also consider using Excel Spreadsheet XML as the target structure (namespace is urn:schemas-microsoft-com:office:spreadsheet).  When you double-click the resulting xml on a PC it automatically opens with Excel. So, users don't see a difference.  It will open up a lot of options with formatting including creating multiple worksheets if you wanted to.  Best of all you can stick with XML.
    See my response in this thread:
    Re: Convert XML data into XLS 
    Thanks,
    -Russ

  • When I am open file with adobe Pro and reader the resolution in my computer failing, change the resolution from 1920x1200 to 800x600. my video card is nvidia quadro 2000. w7 & 32 bits

    when I am open file with adobe Pro and reader the resolution in my computer failing, change the resolution from 1920x1200 to 800x600. my video card is nvidia quadro 2000. w7 & 32 bits

    Hi fabiangs,
    I'm not sure that I follow. Are you saying that when you open a PDF file in Acrobat or Reader, that the display resolution changes automatically on your system?
    What version of Acrobat/Reader are you using? Do you see this same issue in other files/applications?
    I look forward to hearing back from you.
    Best,
    Sara

  • How do you create a jar file with txt and classes?

    Hey, I'm trying to create code to create a jar file with a text file, but I can't figure out how to add the text file. Here is what I have so far:
    try {
                // Name of jar file to write
                String archiveFile = "test.jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("test.txt"));
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
            }It creates the .jar file with the correct manifest but I can't get it to write the test.txt or anything else into the jar file.
    -Gandolf
    Edited by: GanMatt on Jun 18, 2009 8:18 AM
    Edited by: GanMatt on Jun 18, 2009 8:19 AM

    Alright, my question has changed. Here's the code:
    try {
                // Name of jar file to write
                String archiveFile = "test.jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("test.txt"));
                out.write("Hi".getBytes());
                out.flush();
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this,ex.toString(),"BUG!",JOptionPane.INFORMATION_MESSAGE);
            }It creates the jar file with the txt file inside it, but I can't write "Hi" inside of the text file. Any ideas?
    -Gandolf

  • File.setLastModified doesn't work for files with another owner and 777 perm

    import java.io.File;
    public class Main {
        public static void main(String[] args) {
            File file = new File(args[0]);
            System.out.println("exec:" + file.canExecute());
            System.out.println("read:" + file.canRead());
            System.out.println("write:" + file.canWrite());
          System.out.println(file.setLastModified(System.currentTimeMillis()));
    } Compile it to ~. In ~ create file aaa.txt. Next
    ~ $ sudo chown root:root aaa.txt
    ~ $ sudo chmod 777 aaa.txt Checking
    ~ $ ls -la aaa.txt
    -rwxrwxrwx 1 root root 472 2009-11-24 12:09 aaa.txt Running application
    ~ $ java -Djava.security.debug=all Main /home/jfreem/aaa.txt
    scl:  getPermissions ProtectionDomain  (file:/home/jfreem/ <no signer certificates>)
    sun.misc.Launcher$AppClassLoader@1c78e57
    <no principals>
    java.security.Permissions@1186fab (
    (java.lang.RuntimePermission exitVM)
    (java.io.FilePermission /home/jfreem/- read)
    scl:
    exec:true
    read:true
    write:true
    false setLastModified return false and modification time of file remain the same. Why?

    Can you see if the file is getting to the webserver's (not
    ColdFusion)
    temp file directory?
    When a file is uploaded from the browser the
    webserver(IIS|Apache|etc)
    upload it to a temp location, then all CFFile does is copy
    the file
    from the temp directory to where ever specified.
    So you can see if the problem is failing before or after this
    point.
    Grant wrote:
    >
    >
    > We are migrating our intranet from ColdFusion 5 on
    Solaris to ColdFusion MX 7
    > on Linux and I'm testing out the existing applications
    on the new server. The
    > processing page for a file upload is using CFFILE with
    ACTION="upload". The
    > page finishes processing fine, no error, and continues
    as if it was successful
    > but the file never actually gets to the destination
    directory. I tried with
    > larger files and it did take longer (so the file
    appeared to get transmitted),
    > but it still does not get saved to the server's file
    system. This all works
    > fine on the current system running CF5. I've tried the
    CFFILE destination with
    > and without a slash at the end - no difference. We have
    ColdFusion 7.0.1
    > installed. Hot fix 2 has been applied but that did not
    fix the problem.
    >
    > Any ideas?
    >

  • Opening files with double-click and FileVault

    I'm experiencing an issue with 10.7.2 and something is telling me it's related to FileVault. When opening a .txt or .numbers file the associated application (TextEdit or Numbers) will open and display the document. But the pointer turns to the spinning disk and the application won't accept any clicks or keyboard shortcuts. If I alt+tab away from the application I cannot alt+tab or click the Dock icon to return to the application. After a few moments I have to Force Quit the application from the dock. I can also use kill-9 <PID> in Terminal to stop the process.
    This *never* happened before 10.7.2. TextEdit will, about 20% of the time, recover after 1.5 - 2.0 minutes of me just leaving it alone.
    This happens on *every* file I double-click for these applications. If I open the file from within the application (File | Open) it's fine, so I don't think this is a corrupt file problem.
    I open most applications by selecting the desired document from Spotlight (command+space <filename>) - this has the same effect as double-clicking the file with the mouse.
    Can this be related to FileVault? I'm open to coincidences, but because I've used 10.7 the same way (double-click or, more often, Spotlight) when opening files and haven't seen this until I started using FileVault I'm leaning towards that.
    I've not made any modifications to the OS - there are no auto-load programs and I've installed ony about five applications that didn't ship with OS X 10.7.
    Anyone else seen this issue?

    This was getting so frustrating I turned off FileVault and the problem went away. That's too bad, but there it is.

  • Report to a PDF file with Ole Obj and codebar fields

    Im writing a report with some ole objects (images) and a codebar Field. When I run the report saving the result to a PDF file the Ole objects and the codebar fields doesnt appears in it. But, when run it directly in the report builder it does appears. Some idea about it? I would apreciate it.
    Luis

    You mean a barcode? That is a font, not an OLE object. If you have the font installed on your PC, you can have barcodes in your pdf report.
    PDF also has the possibility on embedded fonts, so the font doesn't have to be on every PC. There are several threads about this. Search this forum for 'embedded font', e.g. Font embedding in reports

  • Indesign server web service - where is the support to upload a file with the script and download the result?

    Hi,
    I am working on a POC that is supposed to convert indd files to pdf (i.e. using of course the indesign server). Basically I want to call the IDS Web Service (located on a different machine perhaps), pass in the input file, the conversion script and retrieve the result as part of the WebService call? 
    Browsing the documentation, examples, etc in the SDK, I couldn't see how the above can be achieved without the client handling the file transfer. Surely I must be missing something ...
    thanks
    Chris

    What do you mean with POC?
    InDesign Server is too precious (i.e. license cost) to waste its time with file transfers.
    For a smaller scale, let a separate process (some http or smb server) on the same server hardware handle the files - so that the InDesign Server can access them on the fastest local volume.
    If you plan for bigger, use a dedicated server for file sharing (your choice of SMB, NFS or whatever), where the input files are prepared by the client process, so that your load balancer can immediately point the next free instance of the InDesign server farm to the file. In that case be prepared for some try and error - high speed file sharing can be tricky with files written from one side not yet visible or incomplete to the other side, locking problems, Unicode file name trouble, unexpected time stamps and so forth.
    Btw, there is also an InDesign Server forum which would be more appropriate for such discussions.
    Dirk

  • How can I REPLACE original RAW files with JPG's and keep my 'Develop mode' edits?

    An image describing my problem:
    http://i.imgur.com/hcqMYkv.jpg
    (Lightroom 5)
    'edits' = Edits made in develop mode.
    'CR2' = My RAW image file format.
    I have existing CR2's with edits for them saved in Lightroom.
    I want to replace the CR2's with JPG's, and do nothing else. I want those JPG's to inherit the CR2's edits, but I DO NOT want the edits to be permanently applied to the image.
    If I export the CR2's (which have edits) to JPG's, the edits will be permanently applied to them. I do not want this.
    If I export the CR2's to JPG's without the edits, I have no way of getting the edits back and will have to redo the work if I use that photo again.
    Any solutions? I've been trying for a while and have no idea how to do this.
    Q: Why not keep the CR2's?
    A: I am uploading these files to an online host (S3) as my primary storage method and uploading CR2's takes way too long with my internet speeds. Furthermore, online storage costs money.
    Q: Why not shoot with JPGs instead of shooting raw?
    A: I do my initial edits with the raw files and then archive them as JPG's to save storage space. They won't be raw anymore if I apply future edits, but I still have the option of retouching them from the 'original' state and still have my old edits preserved.

    Probably the best thing for you to do is simply use lossy DNG format (e.g. export as, or convert to..): raw data is re-formatted with jpeg compression (full-rez or reduced-rez), but all raw settings apply.
    If you insist on trying to have a true jpeg file with (mostly) raw settings, then:
    The simplest way I can think of to do it without a script or plugin:
    * Reset the raw photo (consider preserving things that don't translate well, like profile-based lens corrections and white balance).
    * Export jpeg
    * Un-reset the image (e.g. using edit history or pre-reset snapshot).
    * Sync settings from raw to jpeg (note: omit settings that don't transfer well, or that were not reset..).
    * Optionally: Delete raw
    To automate/streamline would require a script or plugin.

Maybe you are looking for

  • Duplicate Files in Windows Photo Gallery

    I am plaqued with duplicates and triplicates of photos appearing in Photo Gallery. I have gone to Options and Import to turn off Autoplay, but whenever I connect my camera or memory chip to a USB port , it starts reading all the files without my inpu

  • Adding videos to a BC site via a web app

    I saw a MaxTempo template that people can use for their Business Catalyst site (http://www.tribevita.com/adobe-business-catalyst-templates/e-commerce/max-tempo-ecom) that consists of a web app that allows the adding and displaying of videos. I saw a

  • Performance of queries against large AD CS databases - how to optimize?

    I am asking experts with experience with AD CS databases with 100.000s or millions of certificate to confirm or correct my "theories". I am aware of these two articles that state performance is not an issue for millions of certificates: Windows CA Pe

  • Warning in BAPI_PO_CHANGE using a custom field

    Hi all,    I have a custom field called 'zpoblock' added to the header level in the purchase order.   I have added the new field to the 'Include CI_EKKODB'.    I need to use the BAPI_PO_CHANGE in order to unblock the purchase orders. When I ran my cu

  • Duplicate layer dialog box

    in config. i want to have a DUPLICATE LAYER button just immediately create a duplicate layer, so its a oneclick process, but instead it pops up a dialog box for me to name the new layer, which i dont want to do, and it makes config. not be more effic