Save file without JFileChooser in specific directory
hi!
can you save a file without opening a JFileChooser dialogue to a specific directory??
the problem I have got is not how to address to the directory but how to save the file....
could someone help me please?
thx
charly
If u only want to save the file instead of selecting from the filechooser then you should use
JFileChooser fc = new JFileChooser();
int retVal = fc.showSaveDialog(frame);
if(retVal == JFileChooser.APPROVE_OPTION)
String filename = fc.getSelectedFile().getName();
getName() will give file name and getAbsolutePath() will give the full path.
filename -> is the file name that u entered for saving in the field. I am not sure if this what u wanted. Hope this helps otherwise pls be more specific in ur question.
Selvi.
I was pondering the same question. if I just open the
dialog, instead of choosing a file from a directory, I
want to type in a new file name, and save it.
help is appreciated.
Similar Messages
-
Monitor for .err file creation in a specific directory
Does anyone know if it's possible to get SCOM to monitor a certain directory and then alert if a .err extension file is created there? If so, are there any instructions you might be able to provide or resources to point me to? I tried
searching but wasn't having too much luck. Any assistance would be appreciated!Hi,
I would like to suggest you create a monitor based on powershell script which can be used to test existance of .err file in a specific directory. The below command can be used to check .err extension existance under D:\specific directory
Test-Path "D:\specific directory\*.err"
Regards,
Yan Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
TEXT_IO.FOPEN how to pick file without specifying the full directory path
Hi,
I am using Oracle application server 10gR2 on Linux with forms 10g application. I am building the DEV/TEST/UAT environment on same Linux machine with one OAS.
I am using TEXT_IO.FOPEN ('/home/oracle/check.txt','r') to read a server side file and it is working fine.
Now I want to pick this file dynamically i.e. without specifying the full path. I am using TEXT_IO.FOPEN ('check.txt','r') and I copied file in forms_path directory in linux and even in $path directory in linux but none of them are working.
Pls help me sort out this problem.
Thanks in advanceHi,
I have to read files in my app directory using TEXT_IO how is that possible?? I cannot set workingDirectory as my Oracle home is in a different location and as has been mentioned by others when I run the form on web it cannot seem to find the file in the default forms directory where all the .fmx file
Is there any other file setting that needs to be done??
Please help
Thanks & Regards
Mangesh Deshpande -
HOW TO SAVE FILES WITHOUT HAVING TO SEARCH FOR DESTINATION FOLDER AGAIN
Hello maybe someone can help me on this one.
I have a MacBookPro. And run loads of applications like Logic Pro, Photoshop, Peak, ProTools, etc.
Everytime I save changes on a project or file i am working on i have to choose the destination folder. Is there a way to save settings so that the last folder chosen automatically comes up when i would like to save new changes i did? I mean now i have to search and choose the destination folder each and every time I want to save changes. Since I have loads of projects i am working on and since i have MANY folders and sub folders this is quite irritating since it slows down my work flow.
I used to use a Powerbook G4 (os x 10.4.11) and I never had that problem. Each and every time I saved changes the machine automatically chose the folder i previously used to save. I never had to save settings for none of the MANY applications I use. This was something that went automatically: My powerbook automatically chose the last folder that i used to save files into.
I'd like to have my MacBookPro do the same.
Anyone knows about this issue?
Thanks in advance.
ps: i tried to explain best as i could in English (i am Dutch so excuse the (spelling) mistakes i might have made)I put an alias in some folders to go to commonly or frequently used locations so I could "Boomerang".
Maybe take a look at the Default Folder utility.
http://www.macupdate.com/info.php/id/7214/default-folder-x
http://www.stclairsoft.com/DefaultFolderX/index.html -
Cannot "Save File" on download to specific folder
I have Win 7 and Firefox 4.0. When I try to download a file from an e-mail (gmail) only the "open" option works and it puts the file in my download folder. If I select the "Save File" button it does the same thing. How can I select which folder to download to? Internet Explorer works OK.
ThanksI have Win 7 and Firefox 4.0. When I try to download a file from an e-mail (gmail) only the "open" option works and it puts the file in my download folder. If I select the "Save File" button it does the same thing. How can I select which folder to download to? Internet Explorer works OK.
Thanks -
Setting default save file in JFileChooser
Is there a way to set a default file name for the save dialog created by
JFileChooser.showSaveDialog(null);in order to save the user needing to type something every time?
Thanks.Exactly
Java keeps ramming classes into the jre that are useful in only a very limited context. At the same time, they can't give us a filedialog that adds the extension onto the returned file... This is something everyone wants, but unfortunately is'nt part of Java. I'm frustrated by it as well (if you can't tell) -
Save files without accessing desktop
Hi
So I have an iMac i think from early 2009 it came with snow leopard it has 4gb ram and 500gb hard drive. Currently it has Mavericks and today I tried to turn it on and a white progress bar appeared under the apple logo, the bar filled gray until just right before the end and then my iMac turned off, this happened twice. I looked up about it and apparently my disk might be defective or something, I tried to repair it with disk utility but it said that disk utility can't repair it and that i have to make a backup, format the disk and restore the copy, I don't have time machine and even thought my external drive is 2tb I don't know how much is free just that is less than 1TB. Also i read that i should try and erase the drive and reinstall OS X but that before that i should save everything I needed and there are some files that I really really need and maybe if I could check all the apps I have, so I can write them down, that'd be great too but it's not that important as saving the files. So, is there a way to do that or the backup? I thought maybe reinstalling mavericks without erasing, saving the files I need and then erasing everything and reinstalling the OS. But i don't know if that is gonna work and i rather not waste time on something that definitely won't work.
Please help and thanks.Reboot to the Recovery Partition, use Disk Utility to create a new partition on the external hard drive formatted as Mac OS Extended (Journaled) Option GUID. Then install the OS on the new partition. Restart holding down the option/alt key, select the external, and boot from it. Use a clone to back up your files. Then use Disk Utility to erase the internal hard drive. Boot back into the Recovery Partition and install the OS on the internal. Then recovery your files by mounting the clone on the internal and selectively restoring your files.
Clone - Carbon Copy Cloner (Often recommended as it has more features than some others)
Clone – Data Backup
Clone – Deja Vu
Clone - SuperDuper
Clone - Synk
Clone Software – 6 Applications Tested -
How to import CSV file which exists in specific directory
Hi,
There is one directory and new csv file is put there in daily batch. And the files have to be imported to DB.
I tried to use DBMS_LOB package, but it doesn't work.. So, if anybody know some good sample code, please tell me.If you are on 10g (not sure which exact release I'm afraid) you might look at Chris Poole's XUTL_FINDFILES that lists the files in a directory using PL/SQL and DBMS_BACKUP_RESTORE.SEARCHFILES (all a bit undocumented as it seems to be provided as part of rman).
-
Save file without FILE_SAVE_DIALOG
Hi experts!
I need to download a massive amount of files to a single folder and i don't want the dialog apear each time.
Is there a way to perform by myself the save_file_dialog?
I have the source path and the destination path.. what should i do next?
(All the files are fom DMS if it's help on the answer)
Thanks,
MaorHi,
do you use gui_download function.
you can just give the specific path and you wont need dialog.
Best Regards,
Burak -
Open files from a specific directory
Dear all,
I have the following source code that simply selects files from a directory.
private void openFile()
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(
JFileChooser.FILES_ONLY );
int result = fileChooser.showOpenDialog( this );
// user clicked Cancel button on dialog
if (result == JFileChooser.CANCEL_OPTION )
return;
File filename = fileChooser.getSelectedFile();
if (filename == null || filename.getName().equals( "" ))
JOptionPane.showMessageDialog( this,
"Invalid File Name",
"Invalid File Name", JOptionPane.ERROR_MESSAGE );
else
// open the file
try
// Open an input stream
FileInputStream fin1 = new FileInputStream(filename);
// Read and print a line of text
BufferedReader d1 = new BufferedReader(new InputStreamReader(fin1));
abs = d1.readLine();
outputArea1.setText("");
outputArea1.append(abs + "\n\n");
outputArea1.setCaretPosition(0);
// Close our input and output stream
fin1.close();
catch (IOException e5) {
JOptionPane.showMessageDialog(this, "Error Opening File", "Error", JOptionPane.ERROR_MESSAGE);
} // end catch
} // end else
} // end private
My question is: Can I force it to open files from a specific directory, and NOT from MyDocuments directory????
thanks,
vxc\r = return
\n = linefeed
\j = illegal escape character
JFileChooser fileChooser = new JFileChooser("C:\j2sdk1.4.2\bin");
You could/should use:
(new File).pathSeparator
or
(new File).pathSeparatorChar
and
(new File).separator
or
(new File).separatorChar
http://java.sun.com/j2se/1.4.1/docs/api/java/io/File.html -
[CS4] save on a local file without user intervention
hey,...sorry for my english...
i work with a other application who need to have the
information written in the local file without an user intervention
so...
i would like to know if it s possible to write or rewrite on
a local file without intervention of the user...
whitout the ""save dialogue box" or with a managed save
dialogue box...
how to write in a local file without user intervention...
i need really an answer to make real my project...
thans for your conprehensionhey
thx a lot for your help ...
if i understand well ...
it is possible to write or rewrite in a specific folder
who is determinated by the application folder of
an specific AIR apllication
who during his install give the ""authorization to
write/rewrite /save in his specific installation foder"
so it s possible with combination of an AIR application.....
can you give me some information about this AIR application
that i must build...
some direction to ask help
because i dont have the knowledges to do that
what style/type of AIR application
what charachteristics of this AIR application....
so some information that can i use to ask help in the good
place...
one more time thx a lot for your help...;) -
How to make Excel 2010 save a HTML report as a file without a folder created
We have a HTML report generated by Oracle Report with headers as below:
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
In Excel 2010, after pressing the "save" button (not "save as"), it will by default save the report as web page format instead of xls, a folder "xxx.files" containing some css, xml and html files are created
in it. If user deletes the folder carelessly, the excel report cannot be viewed at all.
In Excel 2003, we can save it directly in its original format simply by pressing the "save" button, without creating a folder. May I know if there are any options in office 2010, macro or registries settings that can make
Excel 2010 to do the same as Excel 2003 when pressing the "save" button? Thanks!Hi,
According to your description, you want a workaround to avoid creating a new folder when saving a html file in Excel 2010.
In my opinion, this issue is more related to the feature of HTML format or Excel 2010 application rather and I don't think we could resort to a macro or registry settings to avoid that. I suggest you posting it in
Excel IT pro forum for more effective responses.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How do I save a pdf as an html file without losing formatting?
How do I save a pdf as an html file without losing formatting? My coworker is able to do this on her Adobe 9 by saving to html css 4.0 - I have Adobe 11 and have not been able to save as an html at all without loosing formatting.
Are the PDF files that you are attempting to Save As HTML tagged?
-
How to save file in users temp directory in java
How to save file in users temp directory as "<Drive Name>:\Documents and Settings\<User Name\Local Settings\Temp".
Shouldn't the System property "user.home" reference to that directory on windows? So if you call System.getProperty("user.home");, I think it should return that path at least up to <User Name>. I never really tried it on Windows though.
-
How can I navigate to a specific target folder when performing a save file command?
Whenever i click on a Save option for a file, I am eventually presented with a dialog box that gives me a choice of Devices, Favorites and Recent file selections. Which i usually stare at knowing that the actual folder I want the file saved to will not be on the list of options that are presented to me. Nor does there seem to be any way to get around of this dead-end, pre-determined save menu and point the save file process to the folder you want to save the file to. So, when I want to save a file to a specific folder that I have in mind that OSX does not know about, how do I do it?
You have me a bit confused. if you are asking "how do i get a dialog box that i can navigate to any folder with" - there is atriangle next to the file name - click it to "open" and a much bigger dialog box with full finder access wil open. Navigate where you wish and save.
You can also add items to your sidebar.
Grant
Maybe you are looking for
-
Icloud calendar conversion for a family?
For the past 8 or so years I've used a webdav server hosted on my own website for the 6-7 family calendars. I've just upgraded to 4s's and I have 7 mac's in my house and I am hoping to use Icloud as a calendar server. Each computer in the house see
-
Can any one tell me the logic for implementing Dynamic Actions. Regards vamsi.
-
Can't use SMS app with 8800 Sirocco / Bluetooth
Hi all, I can use the Communication Centre to browse phone images / video, contacts etc, but when I use the SMS application, it does not work? It will not read messages from my phone, or even send. It simply says "Failed to send the message". Does an
-
BI omits first characters of the column
Getting realy strange situation with quering data from database - starting from the second row BI omits first n characters, where n is number of current row minus one. For instanse: Column in the database stores POS-терминал iBox N/A Мобильное прилож
-
Is Aperture 2 as good as photoshop?!?!
Hello, i am at college and do alot of photography, we use adobe photoshop cs2 in college, i was wondering if i should get aperture 2 as a cheaper alternative, could you even compare the two. Or is photoshop in a league of its own. Thanks much