Create Directory Dialog box without specifying file name

Hi all Programmers/Developers/JDC memebers
I would like to know in java is there any method or class which helps to give directory dialog box without specifying filename.
I mean to say if u have c,d,e drives and some directories under them
c:\dir1
c:\dir2
d:\dir1
d:\dir2
i want a dialog box,which dispalys all the directories of the selected drive and upon choosing/selecting that directory i should be able to get all the files under them.

Hi,
You can write a file filter for a JFileChooser, in the following way,
public class DirectoryFilter extends javax.swing.filechooser.FileFilter
public boolean accept(java.io.File file)
boolean filter = false;
if(file.isDirectory())
filter = true;
return filter;
public String getDescription()
return "Directories only";
//in your code
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileFilter(new DirectoryFilter());
fileChooser.showOpenDialog() etc. etc..
There's one small issue, by default JFileChooser has a filter called all files filter which you can select from the combo labled "files of type" . So, your file filter won't apply if this filter is chosen.
To disable the all files filter
use
fileChooser.setAcceptAllFileFilterUsed(false);
and only if you are on jdk1.3 or greater since this is a private method in the JFileChooser in 1.2.2 .
Hope this helps,
regards,
Manish     

Similar Messages

  • Creating a dialog box with OK and Cancel buttons without OADialogPage

    Hi Experts,
    i want to create a dialog box for Delete Confirmation means after clicking on delete it should pop up a small dialog box with OK/Cancel buttons
    and need code for the same to handle the buttons.
    i have created with OADialogPage but its showing in a complete page but i want to show those buttons in a small box.
    Plz help.
    THANKS IN ADVANCE.
    Thanks
    Raja.

    Hi,
    I have not tried using javascript in destination URI as suggested by Mukul.
    I have tried the below code for opening a page as dialog box.
    You can try it for your requirement by creating a dialog page of your own, say XXDialogPage (with OK and Cancel button)
    StringBuffer l_buffer = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    String url = "/OA_HTML/OA.jsp?page=/xx/oracle/apps/fnd/dialog/webui/OADialogPG";
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:500, height:500},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    In dialog page's controller, you can forward it to the page onc ethe user selects OK or Cancel.
    Pass the selected value back to the main page and further you can use it for deleting.
    Regards.

  • 30EA3 - multiple errors in "Create Tablespace" dialog box

    I have noticed the following errors in the "Create Tablespace" dialog box (in the DBA view).
    1) In the "File Specifications" tab, if you try to use a period in the file name (for example "data01.dbf") , you get an error message "Validation Failed: Name DATA01.DBF contains an illegal character."
    2) The tool is automatically changing the case of the file name to all upper case. You can work around this by enclosing the file name in quotes, but you shouldn't have to do that.
    Overall, I've been real happy with the product, and that Oracle keeps improving it.

    I've also run into this, recently, in version 3 on Windows 7 (db is version 10g on Solaris 10/SPARC64). Although the error message is now "Name TABLESPACENAME.DBF contains an illegal character." Also found the described capitalization overriding what user types in.

  • How to modify 'Specified File Name' of a scheduled report

    I run a daily scheduled report every morning and send it out as an emailed attachment. My problem is, I want the file name of the pdf attachment to include the previous day's date. How can I modify the 'Specified File Name' setting in the destination tab to reflect the previous day's date. I do not want to use %SI_STARTTIME% because that only shows the date&time that the report was actually run....I need the previous date. So far I am unsuccessful.
    Thanks

    Hi,
    i think this is only possible via the SDK. I would recommend creating a Support Message with SAP to solve this issue.
    Maybe there is already Samplecode available from the Support.
    Regards
    -Seb.

  • How to read a ftp file with a specified file name in Proxy-XI-File scenario

    Dear all,
    I have the following requirement:
    The end user send a request via the proxy to XI, within the request parameters there is a file name, and the XI need to retrieve the file content from a ftp server with this specified file name, how can I achieve this?
    According to my understanding, the file receiver adapter can only write the files to the server.
    Thanks and regards,
    Bean

    Dear Bean,
    This can be achieved using a BPM...
    you will have to use Two parallel receive steps within a fork...
    1. 1st receive step :This will bring the data from the proxy
    2. 2nd receive step :according to pipeline step before this step would be executed interface determination would be called withini that you can put a mapping wherin the source and target message type would be as follows
    a. source message type ; the file structure that is going to be picked from ftp structure
    b.target message type : same structure as source except at top you will add "filename" field
    (you cna find on forum how we can get a fielname in the mapping ..in case you dont knw )
    3. now you can define correlation on the field "fielname" in both the receive steps provide the hirearchy and structure of data coming from both file and procy are same...
    4..  after corelation you can put any steps like transformation ( as you want)
    Hope this helps

  • Firefox 3.6.6, avast 4.8.0 shows trojan in the firefox exe upx. When I go to move it to the vault a dialog box says the file an not be found

    I am running firefox 3.6.6, Avast 4.8.0 shows a trojan in the firefox exe upx. When I go to move it to the vault a dialog box says the file an not be found. I uninstalled firefox and got rid of all firefox traces using Revo. but I still get the trojan warning.
    == This happened ==
    A few times a week
    == I upgraded my firefox ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

    Firefox works fine on Windows 2000 SP4 for me.
    Any chance you have a dial-up connection that uses a web accelerator to speed the loading of content?

  • How to create Information Dialog boxes in web Dynpro

    Hi,
    'm new to webdynpro.
    Can any body help me to create a dialog box.
    I would like to know how to create dialog boxes of type information, confirmation and warning
    expects reply
    thanks
    smitha

    to create confirmation dialog I tried the code
         IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
        String dialogText = "The email was successfully sent!";
        IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow( dialogText, controllerInfo.findInEventHandlers("ok"), "ok");
        dialog.addChoice(controllerInfo.findInEventHandlers("newEmail"), "new email");
        dialog.open();
    and I got error like:
    java.lang.NullPointerException
         at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.<init>(ConfirmationDialogDelegate.java:58)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createConfirmationWindow(ClientComponent.java:926)
         at com.enteg.systallocpkg.LoginView.onActionLogin(LoginView.java:157)
         at com.enteg.systallocpkg.wdp.InternalLoginView.wdInvokeEventHandler(InternalLoginView.java:137)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:100)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:299)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    I don't know how to solve this
    can any body help me
    Smitha

  • When I open the "Save Page As" window, the drop-down box for the file name shows files that were saved long ago. This is not cleared by any "clear history" function that I can find. How do I clear this?

    # Question
    When I open the "Save Page As" window, the drop-down box for the file name shows files that were saved long ago. This is not cleared by any "clear history" function that I can find. How do I clear this?

    Hello.
    I believe this is a Windows related issue, since it's the windows Save File manager we're talking about here (right?). You should contact Microsoft for help on that one, I believe. You'd expect to be able to delete the entries by simply tapping ''Delete'' on your keyboard when they are focused (that's how it goes for deleting specific form autocomplete entries in Firefox), but I haven't tried that.
    I'm sorry I can't be of more help.

  • How to create conditional dialog box

    Hi Everyone
    I am creating a database application in APEX 4.0. In that application a page requires a dialog box, which has to appear when a user clicks on Submit button.
    It has to consider validations and appear after validations and submit button is clicked. Here the Submit button submits the entire page after validations by updating the database table.
    Please help me out how to create a dialog box which has to appear by the click of Submit button.
    Thanks in advance
    Regards
    Sandeep

    Hi Kiran
    Thanks for responding,
    Sorry for providing the complete details.
    Provided link is much more helpful, but its not meeting my needs. My requirement is to just show a popup box after the user clicks on submit button.
    Saying 'Thank you for answering' if he is done with all questions or if he has more questions to answer pop up with different message 'You have more questions to answer'.
    In both the cases page as to get submitted when clicked on Submit button.
    Thanks in advance
    Regards
    Sandeep

  • Can't find "Create Slideshow" dialog box.

    I have Premiere Elements 7, and am trying to create a slideshow.  The Help page refers to a "Create Slideshow" dialog box, but I don't see that anywhere.  I've looked through every menu, every icon, and tried right clicking on the photos that were dragged down to the timeline, but no slideshow option.
    I've done slideshows manually using PE7 before, but it's a big pain having to manually reset the duration of each slide, rather than changing the default somehow.
    Thanks!
    Bennett

    There are actually four different ways to build slideshows in Premiere Elements, and I show you how to do each in my books.
    But I think you're referring to the slideshow creator on the Project panel. To use it, select several stills or clips in the Project panel (by selecting as you hold down the Ctrl or Shift key) and right-click. This will open the panel I think you're looking for.

  • Jump to next frame label without specifying a name

    Is it possible to jump to next frame label without specifying
    the name of the frame label?
    For example instead of saying
    on (release) {
    gotoAndPlay("Step_02");
    I wanted it just to go to next available frame label.
    Thanks
    Jonas

    not with actionscript 2.

  • Inserting values for all records except 1 or 2 column ,without specify column names.,?

    Hi,
    for example, in student table i am having 1000 columns,  column names like(id ,name,class, dept,etc,.).
    i want to insert 998 fields to department table from student tables except(id,class).
    i don't want to mention all column names in the insert command,
    is there any possibilities to filter the column names in insert command like (EXCEPT, NOT IN).
    Thanks in advance..

    duplicate of
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b31fa034-5b8f-42e4-b4e1-592a632ca6a5/inserting-values-for-all-records-except-1-or-2-column-without-specify-column-names?forum=sqlce
    please dont cross post
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Open Hyperlink column in sharepoint list in Modal dialog box without redirecting to any page.

    Please help me to achieve:
    open Hyperlink column in SharePoint list in Modal dialog box without redirecting to any page.

    You can use the JSLink to achieve it:
    link
    [custom.development]

  • Click on download of pdf opens adobe acrobat reader, but then clicking on file save-as does not give a dialog box to change the name or location where it is sav

    Using Firefox 19.02
    When I receive an email with an Excel, Word, or PDF file attachment, and I click download, firefox opens up the associated program for all my users, however when you click on file>save-as you are not presented with the dialog box to perform a save.
    Excel and Word, no fix at all. Other than different browser or to click download, right click and go to folder, and then copy it out of there to another folder and open it.
    Help, what is going on here????
    Gordon rutherford

    BTW: using Adobe Acrobat Reader XI

  • Print to PDF and specify file name.

    Hardware/Software Details:
    MacBook 2GHz Intel Core 2 Duo
    OS 10.5.5
    Adobe Acrobat Professional 8.1.2
    Hey all,
    I'm a teacher and I've been scripting PDFs for use as marking sheets for assignments. What I'm trying to achieve is a situation where I tick all the boxes, marks are calculated and comments filled-in using my form fields (which all work fine) and then produce a PDF from that file with the student's name as the new file name (which is where I'm stuck!).
    In the past, I've had a button that on mouseOver brings the field with the student's name into focus, mouseDown evoked the File:Copy menuItem (copying the student name to the system's clipboard) and then mouseUp which triggered File:Print from which I would choose 'Adobe PDF 8.0' as the printer, hit Save, paste the student's name as the file name and choose the appropriate directory.
    File:Copy is no longer a "safe" menu item according to the latest versions of Acrobat, so I'm having to manually copy the name which is complicating the process further.
    I'm working on a script activated by the mouseUp of a button in this PDF which is currently looking like this:
    >var pp = this.getPrintParams();
    // format name to remove spaces and commas
    var studName = this.getField("Name").value.split(",").join("_").split(" ").join("");
    pp.interactive = pp.constants.interactionLevel.silent;
    pp.printerName = "";
    pp.fileName = studentName + ".ps";
    this.print(pp);
    Although the console will list 'AdobePDF8' as one of my printers, I've since discovered that "the destination printer cannot be set through this property in Mac OS" :( . I can set it as my default printer to work around it, but I still can't dictate the name of the new file. So, I've resorted to printing to PostScript with the aim of running them all as a batch through the AdobePDF8 printer later, except there's still a few problems.
    The name of the PostScript file won't work when I try to include the value of another variable (var studentName)
    The fonts in the PostScript files that it does produce get substituted with Courier and look terrible
    Both the API Reference and the Developer Guide seem to indicate that you can print to a file rather than a printer, but both only seem to mention PostScript file using this method.
    Is there another way to do this? If not, is there a solution to the two problems I mentioned?
    Cheers,
    Chris

    Ok, I've pursued the SaveAs method (as George suggested) with moderate success with the following code (secure function names have been changed ;) ):
    config.js file script:
    >myTrustedSaveAs = app.trustedFunction( function ( doc, studName )
    app.beginPriv();
    doc.saveAs({
    cPath: studName,
    bCopy: true,
    bPromptToOverwrite: true
    app.endPriv();
    myTrustedOpenDoc = app.trustedFunction( function ( path )
    app.beginPriv();
    app.openDoc({
    cPath: path
    app.endPriv();
    Button's onMouseUp script:
    >// get student name and turn it into a file name
    var studFile = this.getField("Name").value.split(",").join("_").split(" ").join("") + ".pdf";
    // get the current document's directory path
    var origFile = this.path;
    var pathBits = this.path.split("/");
    pathBits.pop();
    // whack 'em together
    pathBits.push(studFile);
    var studFilePath = pathBits.join("/");
    // toss the form fields and stuff
    this.flattenPages({
    nNonPrint: 2
    // save the new file
    myTrustedSaveAs(this,studFilePath);
    // open the original again (not working)
    myTrustedOpenDoc(origFile);
    // close the one I just saved
    this.closeDoc(true);
    This is what happens:
    Button is clicked,
    All the form fields and buttons are removed,
    It produces a file with the new file name (e.g. Lawrence_Chris.pdf) next to the original,
    The file closes
    I'm pretty sure that once the SaveAs runs and the new file is created, I actually still have the original file open instead of the that was just saved. This would explain why the openDoc command doesn't seem to do anything because the file it's opening is already open. The closeDoc then runs and of course I then have no open documents!
    So, now I either need a way to revert the open original file so I get all of my form fields back and don't have to reopen it, or a way to close and then immediately open the file without saving changes. :/
    Any ideas?
    slight inconvenience of needing a separate .js file written for the user's JavaScript folder before launching Acrobat to overcome security restrictions. File sizes only seem to get down to about 376KB as opposed to the 40KB files that the AdobePDF8 printer spits out. :(

Maybe you are looking for

  • How do i merge multipule pdf files into one file?

    how do i merge multipule pdf files into one file?

  • Issues with multiple subnets - ASA5510 to Vigor 2820 VPN

    Hi there, I am hoping someone here can help.  I have been struggling for some time to sort out issues in a VPN we have between our main London office and the Edinburgh branch office.  We have an ASA 5510  in London, talking to a Vigor 2820 in Edinbur

  • How to Single Sign-On?!?!

    One of the advertised features of LiveCycle Rights Management ES clearly says: (http://www.adobe.com/products/livecycle/rightsmanagement/features.html) "Work with Microsoft® Windows® SSO to provide transparent authentication" How exactly do I achieve

  • Composite to tv no video?

    When I connect my iphone to a digital TV using the composit AV cable.  I get audio by no video.  The tech sheet says "Make sure you set your IPhone to send a video signal out to your TV, see user guide for your IPhone. I've looked in the guide but ha

  • How to add user from domain A to a group in domain B

    How would you acheive adding a user from domain A to a group that is in domain B via powershell without the Quest cmdlets? I've been trying to figure this out for about a week now. Please let me know if the scripting guy has seen this issue before. L