Filedialog Box

Hai,
       How to use Filedialog and Frame in webdynpro ..in java using below type
<b>FileDialog f1=new FileDialog(new Frame(),"open");
          f1.show();    </b>
the same think i want use in webdynpro......is there any option........
Regords,
Boopathi

Hi
u can check all the API required for File Dialog Box here
http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm
Regards
Puneet
Message was edited by:
        Armin Reichert

Similar Messages

  • Changing the file type as.....in FileDialog Box

    hi
    i wanted some help in file Dialog box......
    as soon as i click the browse button in my java program....a window opens which is the file dialog....
    the option specified below is file type as ....
    i'm getting only 1 option i.e file type as - all files...
    i wanna change that all file type to only *.doc files......how do i do it....
    i want only the *.doc optoin to appear in the combobox....
    is it possible

    oops... sorry 'bout that, I shouldn't take links from files on my hdd ^_^
    I meant THIS method : JFileChooser.addChoosableFileFilter(FileFilter)

  • Displaying only folders in FileDialog

    I would like to create a dialog box that would allow the user to
    choose a directory, not a file. Is there any way to use the FileDialog box available in AWT to do this (and using Swing is not an option and i know how to do it in JFileChooser)??
    Any ideas or samples to how to do this would be greatly appreciated!

    I have not tested if this works, but you can try using the directory filter below via FileDialog's setFilenameFilter method.
    public class DirectoryFilter implements java.io.FilenameFilter {
    public void accept(File dir, String name) {
    File file = new File(dir, name);
    return file.isDirectory();

  • FileDialog

    How do use the FileDialog class to open a FileDialog box in your Java Program or is there something better to use?

    Please look at javax.swing.JFileChooser
    This will allow you to select (one or more ) Files or Directories while applying any filter you choose.
    -John
    null

  • FileDialog in java

    Hello,
    Previously i am using JfileChooser,but it is not compatible with Mac.
    Now I m using Filedialog box in the place of JFileChooser.
    Please suggest me how i can set true for multiple file selection.
    Thanks in advance.

    hi,
    setSelectMultiple(boolean multiple)Set whether the user can select either one or multiple files.
    more methods (java API)
    http://www.nsydenham.net/java/NRSUtils/doc/nrs/util/file/FileDialog.html

  • Application to read 2 log files from internet

    Hi,
    Anybody could tell me how to develop this project. I'm lack of time. thanks
    You have been asked into a company called Broken Arrow Software as a Senior Software Engineer and Management consultant. You are being paid very handsomely and have been asked to write an application program in Java for parsing a log file.
    � The program will have a standard menu using the AWT only.
    � ALL LAYOUTS MUST USE ONLY THE BORDER-LAYOUT OR GRID-LAYOUT OR A COMBINATION OF BOTH (Any other layouts score zero).
    This application reads two Log files from the internet. The first file contains USA state names and the abbreviation used for that state. This information will be used in displaying totals from another network file and should be stored in an array (or two arrays, or a two dimensional array) in the program. The second file should extract the �Reversed subdomain� section from a Log file (a section is shown later) and store this in an array in the application. This should be processed and only those domains beginning with �us.� should be processed. Each �us.� Has an abbreviated USA state after it (�tx� is an abbreviation for Texas). The abbreviations are sorted and all states are on consecutive lines and each displays a number of accesses for that state. The accesses should be totalled and displayed in the current Frame for each state in the form of Java List components (these do not need to be synchronised so that they all scroll in unison).
    The application will be a Java application with the following menus and MenuItems:
    � Splash screen (10%)
    � Application (20%)
    o Open USA abbreviation file
    o Clear screen
    o Exit
    � File (25%)
    o Open network log file
    o Open locally saved report file
    o Recent report files
    o Save as report file
    � Graph (20%)
    o Plot
    � Help (15%)
    o Help on Application
    o About
    A basic pass for the application will be for a basic implementation of an application with �help� options and some basic implementations of a Splash screen and some basic file and application options. Very high marks will be awarded for processing network files, saving and opening files, very good HCI, application design and error handling, excellent OO design for classes, gorgeous layout and commenting of code and excellent graphing capabilities.
    Error handling dialogs and overall application design (10%)
    Every class must be in a separate file.
    Inheritance should be used for WindowListeners of Frames and Dialogs.
    Up to 10% can also be lost by unprofessional code layout and lack of professional standards. Always adhere to standards taught throughout the module and your time at the University of Northumbria.
    Examples of non-professionalism would include bad indentation, no comments, meaningless variable names, politically incorrect graphics, commented out code, empty .java files, .java files which are not part of the project etc. Remember your application is your livelihood and your company depends on your application standards.
    The splash screen must be a Frame with a Canvas as part of it showing your own logo. Your logo should be individual to you but does not need to win the computing equivalent of the Turner prize. The application should be displayed behind the Splash screen and both should be visible. The application must not be able to be brought to the front and used without the Splash screen being disposed of.
    The application should only enable the �Open USA abbreviation file�, �Open locally saved report file�, �Help� options and �Exit� Menus and MenuItems, when the application starts. On opening a valid USA abbreviation file, then the other Menus and MenuItems should be enabled.
    The abbreviations should be read into an array. These should be used in displaying the totals for the reversed subdomain totals for each USA state. A total for all USA states should be displayed at the bottom of the current Frame, with a suitable Label (this design is your own). This current Frame should display a series of Lists starting with a List of USA state number (1 to n). A List of USA state abbreviation should be next followed by a List of the actual USA state name, followed by a List of the total accesses for that state.
    The report file should be an ASCII file that can be printed out from an ASCII text editor such as DOS edit or Microsoft NotePad.
    The �Open� network files should display a Dialog asking for the http:// address of the file, with �OK� and �Cancel� options. It is helpful if the user can hit �return� instead of clicking on �OK� and �Escape� instead of �cancel�. Error Dialogs should be used to indicate any errors that may occur and the state of the application should be reset to that of before displaying the Dialog.
    When �Save as report file� is chosen a FileDialog box should be used for the user to choose both directory and filename. The file should be able to be saved as a �.rpt� file.
    Open report file should display the report in a Frame; the design of which is your own.
    Plotting the graph should pass a two dimensional array to a Frame with a Canvas. The Canvas should have a Paint method that draws the axis for the graph and any suitable Headings etc. The graph should draw a histogram of totals per USA states. The graph design is your own but you may wish to use Microsoft Excel as a good example of drawing a histogram.
    The �Clear screen� option should clear any data off the current screen.
    The �Exit� option should quit the application but it may be helpful to ask the user if they really want to exit the application.
    Help must be Java code and not linking into HTML. It should display help in a well designed screen. The most basic implementation might use a scrollable TextArea for a basic mark.
    See other software for a good �About� screen. The most basic should display your name, date, version and company.
    � Help should display your help on using the application. As a senior software engineer, the design is your own, based on experience of using applications, as is the opening splash screen. You may use other applications for inspiration only, as these will make up your experience.
    � Your good knowledge gained from HCI units studied should prove invaluable in the interface design and the usability of the application.
    � The design (Screens and classes) and quality and documentation of code throughout the application will be marked. The experience gained from programming 1 and 2 and Object Oriented Programming should prove invaluable throughout the application, as should any GUI units studied.
    The log file can be accessed at:
    http://computing.unn.ac.uk/staff/cgpb2/public_html/log.html

    You would really gain ever so much more from this exercise if you would write a couple of classes, then come back with some specific questions. If you're completely lost, try starting with the GUI first. It's not the best practice, always, but it is easy to visualize.
    On a side note, I wish I'd had assignments even half this intersting when I was in my Java classes...

  • Urgent:HOW TO CREATE A PROGRAMME WITH MENUS AND MENUITEMS IN AWT?

    hi am new to java..............and i know very less about java
    can anyone help me by sending the code for creating menu with file,edit ,view and menuitems as open,save,exit.
    and also plss help me how to get a filedialog box in the same programme when i click the open in filemenu.
    in AWT.....................plsss urgent

    sangi wrote:
    hi am new to java..............and i know very less about javaredundant and barely intelligible
    can anyone help me by sending the code for creating menu with file,edit ,view and menuitems as open,save,exit.have you tried a Swing demo? aside from the fact that this code has likely been written and published hundreds of times on the web, a simple tutorial would have shown you how to do this.
    and also plss help me how to get a filedialog box in the same programme when i click the open in filemenu.
    in AWTslow down, one thing at a time
    go do the tutorials first
    .....................plsss urgentstating your task is urgent is offensive here
    learn how to communicate lest you get flamed
    good luck

  • Struts file upload and download

    hai,
    Am new to struts...my specification is onclick of button i should open a filedialog box ,from where we will select a document.am able to do this and am able to get file name , size,type using formfile in action class.but i dont know how to upload the file which i have selected to the server .At same time when the user clicks View , he will be able to view the file in its specified formate.....that is if it is a .pdf means ,should open in pdf formate...plz help me

    hi ...
    now am able to open text,rich text file but not pdf,exel .*.giff,*.tiff,*.tar..
    my code is
    File file = new File("d:/laya/"+selectDocVO.getFileName());
                   int readCount = 0;
    FileInputStream fileIn = new FileInputStream(file);
    response.setContentType(SelectDocVO.getFileType());
    response.setContentLength((int) selectDocVO.getFileSize());
    response.setHeader("Content-disposition", "attachment; filename=d:/laya/" + selectDocVO.getFileName());
    response.setHeader("Cache-Control",
              "max-age=" + TIMEOUT);
    response.addHeader("Content-description","My Description");
    ServletOutputStream outStream = response.getOutputStream();
    byte[] buffer = new byte[1048576];
    int sent = 0;
    while ((readCount=fileIn.read(buffer))!=-1){
    outStream.write(buffer,sent,selectDocVO.getFileSize());
    outStream.flush();
    Plz help me
    return (null);

  • Can it be done in java?

    hi,
    i am doing a project in which the following needs to be done:
    i have a set of map files with me. now in my project, i need to create a frame with an icon. when i click on the icon, i should get a window that should allow me to choose any one of the map files that i already have.
    can this be done in java or is it easier to implement it in java script? i will appreciate if any of u can suggest me the exact procedure to follow preferably using java.

    Yes it can be done in java. If you want to do it as applcation then there is no problem. But if you want to write an applet then the applet should be signed.
    the way is, create a button with a image. handle the buttons action event and in that display filedialog box to select the file.
    Thanks
    Regards
    vivek

  • Zip  a folder??

    Hi all friends,
    I want to zip a folder not file by using java.util.zip package. My requirement is I have one swing interface on button action event i want to zip a folder by opening Filedialog Box by selecting that folder from my hard disk.Is it possible? If it is not possible then Is there any other way to zip a folder.
    Regards
    Bikash

    yes i have compiled and also run it
    i got the problem
    actually this forum hides the square bracket and deals it as italic
    here's teh modified code
    import java.io.*;
    import java.util.*;
    import java.util.zip.*;
    * JZip can zip and unzip files or directories compressed or not.
    * It can be used as application or as API.
    * @author Gopal Kalsekar, MITL
    public class JZip
         protected String outputName;
         protected Vector inputNames = null;
         protected int compressMethod = ZipEntry.DEFLATED;
         * Constructor
         public JZip()
         * Constructor
         * @param outputName output zip file name or unzip output path
         * @param inNames input files or directories names to zip or unzip
         public JZip(String outputName, Vector inNames)
              this.outputName = outputName;
              this.inputNames = inNames;
         public static void main(String<> args)
              Vector zipFileNames = new Vector();
              Vector listFileNames = new Vector();
              String directoryName = null;
              String outputName = null;
              String inputName = null;
              boolean isZip = true;
              boolean isHelp = false;
              boolean isCompress = true;
              boolean isOption = true;
              for (int i = 0; i < args.length; ++i)
                   if (args<i>.equals("-h") || args<i>.equals("-help"))
                        isHelp = true;
                   else if (args<i>.equals("-d"))
                        isZip = false;
                   else if (args<i>.equals("-o"))
                        if ( i == args.length - 1 )
                             isHelp = true;
                        else
                             directoryName = args<++i>;
                   else if (args<i>.equals("-u"))
                        isCompress = false;
                   else
                        if (isOption)
                             isOption = false;
                             zipFileNames.addElement(args<i>);
                        else
                             if (isZip)
                                  listFileNames.addElement(args<i>);
                             else
                                  zipFileNames.addElement(args<i>);
              if (isZip)
                   if ((zipFileNames.size() != 1) || (listFileNames.size()) == 0)
                        isHelp = true;
              else
                   if (zipFileNames.size() == 0)
                        isHelp = true;
              if (isHelp)
                   System.out.println("Usage: java JZip <-h> <-d> <-u> <-o <outputDirectory>> zipFile fileList\n" +
                   " -h display this list\n" +
                   " -u uncompressed\n" +
                   " -d unzip\n" +
                   " -o <outputDirectory> output the files into the 'outputDirectory' directory\n"+
                   " zipFile zip file name\n" +
                   " fileList the zipped files list");
              else
                   try
                        JZip jZip = null;
                        if (isZip)
                             if (directoryName != null)
                                  if (directoryName.endsWith(File.separator))
                                       outputName = directoryName + (String)zipFileNames.elementAt(0);
                                  else
                                       outputName = directoryName + File.separator + (String)zipFileNames.elementAt(0);
                             else
                                  outputName = (String)zipFileNames.elementAt(0);
                             jZip = new JZip(outputName, listFileNames);
                             if (isCompress)
                                  jZip.zip();
                             else
                                  jZip.zipUncompressed();
                        else
                             if (directoryName != null)
                                  outputName = directoryName;
                             else
                                  outputName = System.getProperty("user.dir");
                             jZip = new JZip(outputName, zipFileNames);
                             jZip.unzip();
                   catch (Exception e)
                        e.printStackTrace();
         * Set zip compress method type
         * @param method set method as ZipEntry.STORED to uncompress or
         * ZipEntry.DEFLATED to compress
         public void setMethod(int method)
              if (method == ZipEntry.STORED || method == ZipEntry.DEFLATED)
                   compressMethod = method;
         * Do unzipping by the instance which has been created by the constructor
         * JZip(String, Vector).
         * @exception IOException if I/O error occurs
         public void unzip() throws IOException
              String inputName = null;
              FileInputStream fis = null;
              for (int i = 0; i < inputNames.size(); ++i)
                   inputName = (String)inputNames.elementAt(i);
                   fis = new FileInputStream(inputName);
                   unzip(fis);
                   fis.close();
         private void unzip(InputStream is) throws IOException
              FileOutputStream fos;
              File file;
              ZipInputStream zis = new ZipInputStream(is);
              ZipEntry zipEntry = null;
              byte<> buffer = new byte<1024>;
              int readCount = 0;
              String outputDirectory;
              outputDirectory = outputName + File.separator + File.separator;          
              outputDirectory.replace('/','\\');
              while ((zipEntry = zis.getNextEntry()) != null)
                   String filename = outputDirectory + zipEntry.getName() + File.separator;
                   String remslash = zipEntry.getName();
                   remslash = remslash.replace('/','\\');
                   File tmpfile = new File(outputDirectory+remslash);     
                   file = new File(tmpfile.getParent());
                   if (!tmpfile.exists())
                        file.mkdirs();
                   if (remslash.trim().indexOf(":") != -1)
                        remslash = remslash.substring(remslash.indexOf("\\",3) + 1);
                   fos = new FileOutputStream(outputDirectory + remslash);
                   while ((readCount = zis.read(buffer)) != -1)
                        fos.write(buffer, 0, readCount);
                   fos.close();
              zis.close();
         * Do unzipping by special output path and input stream.
         * @exception IOException if I/O error occurs
         public void unzip(String outputDir, InputStream is) throws IOException
              this.outputName = outputDir;
              unzip(is);
         * Do zipping by the instance which has been created by the constructor
         * JZip(String, Vector).
         * @exception IOException if I/O error occurs
         public void zip() throws IOException
              File creatFile = new File(outputName);
              creatFile = new File(creatFile.getParent());
              if (!creatFile.exists())
                   creatFile.mkdirs();          
              FileOutputStream fos = new FileOutputStream(outputName);
              zip(fos);
              fos.close();
         } // end of zip()
         private void zip(OutputStream os) throws IOException
              ZipOutputStream zout = new ZipOutputStream(os);
              File file = null;
              String inputName = null;     
              for (int i = 0; i < inputNames.size(); ++i)
                   inputName = (String)inputNames.elementAt(i);
                   file = new File(inputName);
                   if (file.isFile())
                        zipFile(zout, inputName);
                   else if (file.isDirectory())
                        if (!inputName.endsWith(File.separator))
                             inputName = inputName + File.separator;
                        zipDirectory(zout, inputName, file);
              zout.close();
         * Do zipping by special output stream and input files or directories.
         * @exception IOException if I/O error occurs
         public void zip(OutputStream os, Vector inputNames) throws IOException
              this.inputNames = inputNames;
              zip(os);
         private void zipDirectory(ZipOutputStream zos, String directoryPath, File directoryFile) throws IOException
              if (directoryFile.canRead())
                   String<> fileNames = directoryFile.list();
                   File file = null;
                   if (!directoryPath.endsWith(File.separator))
                        directoryPath = directoryPath + File.separator;
                   for (int i = 0; i < fileNames.length; i++)
                        fileNames<i> = directoryPath + fileNames<i>;
                        file = new File(fileNames<i>);
                        if (file.isDirectory())
                             if (!fileNames<i>.endsWith(File.separator))
                                  fileNames<i> = fileNames<i> + File.separator;
                             zipDirectory(zos, fileNames<i>, file);
                        else if (file.canRead())
                             zipFile(zos, fileNames<i>);
                        else
                             throw new IOException("The File '" + fileNames<i> + "' can't be read.");
              else
                   throw new IOException("The directory '" + directoryPath + "' can't be read.");
         private void zipFile(ZipOutputStream zos, String inputFileName) throws IOException
              String originalinputFileName = inputFileName;
              if (inputFileName.trim().indexOf(":") != -1)
                   inputFileName = inputFileName.substring(inputFileName.indexOf("\\",3) + 1);
              FileInputStream fin = new FileInputStream(originalinputFileName.trim());
              int bytes_within_file = fin.available();
              byte<> buffer = new byte<bytes_within_file>;
              int readCount = 0;
              ZipEntry zent = new ZipEntry(inputFileName.trim());
              zos.putNextEntry(zent);
              while ((readCount = fin.read(buffer,0,bytes_within_file)) != -1)
                   zos.write(buffer, 0, readCount);
              fin.close();
              zos.closeEntry();
         * Zip uncompressed
         * @exception IOException if I/O error occurs
         public void zipUncompressed() throws IOException
              compressMethod = ZipEntry.STORED;
              zip();
    just copy this code in a text pad
    and replace '<' with open squarebarcket '['
    and '>' with close square bracket ']'
    wherver it occurs
    hope its clear

  • Dialog boxes and file download

    I need to make a program(open dialog box) that will choose a file and return the filename that it chooses. And i also need a program that will download a txt file from a pc to my own pc. I need help
    i am new to java, ive just recently download j2sdk but i have trouble doing some codes coz its my first time. Please help. thanks in advance.

    Try this code in the action performed section of a browse for file button of ur dialog ..
    public void actionPerformed(ActionEvent e)
    Object obj=e.getSource();
    if(obj == browseButton)
    {  FileDialog  fd= new FileDialog(new Frame(), "Choose File");
    fd.setVisible(true);
    String fullPath =fd.getDirectory() +fd.getFile();
    textField1.setText(fullPath);
    About the second qusetion u need not download file from ur machine to your own machine unless for testing..
    So for ur purpose i think u can just open the file using the code ..
    import java.io.*;
    public class temp{
    public static void main(String args[]) throws Exception
         String in="C:\\dir1\\inputfile.txt";
         String out="C:\\dir2\\outputfile.txt";
         File fileFrom = new File(in);
         File fileTo = new File(out);
         FileInputStream fin = new FileInputStream(fileFrom);
         FileOutputStream fout= new FileOutputStream(fileTo);
         long len = fileFrom.length();
         byte[] temp= new byte[(int)len];
         int x;
         fin.read(temp);
         fout.write(temp);
         fin.close();
         fout.close();
    hope u will be able to solve ur prob.
    Have a great time..

  • How to incorporate File name and timestamp automatically into select and save file dialog box?

    Hello,
    i am trying to incorporate the file name which is inputed by the user along with the timestamp into the selected and save file dialog box. Can you help?
    Thanks
    Solved!
    Go to Solution.

    You can pass a default file name to the 'File Dialog' Express VI.
    Use the 'selected path' output to open the file.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness
    Attachments:
    FileDialog.vi ‏21 KB

  • FileDialog filter

    Hi
    I'm using dialog boxes for Open and Save in my progra. Question is: Is it possible just to filter for java and text files.. heres my code.
    fd2=new FileDialog(this,"Save As..",FileDialog.SAVE);
    fd1=new FileDialog(this,"Open..",FileDialog.LOAD);
    Open.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent ae2 )
    txtmsg="";
    fd1.setVisible(true);
    String filename=fd1.getFile();
    String dirname=fd1.getDirectory();
    File openfile=new File(dirname,filename);
    try
    FileInputStream fis=new FileInputStream(openfile);
    int bytelength=fis.available();//calculates the file size
    for (int bytecount=0;bytecount<bytelength;bytecount++)
    char fch=(char)fis.read();
    txtmsg=txtmsg+fch;
    ta.setText(txtmsg);
    catch(Exception ioe)
    System.out.println("An exception has occured");
    );

    yes it is possible
    doublle click JAVA_HOME\demo\jc\swingset2\swingset2.jar (its long to start, be patient)
    for source code look in JAVA_HOME\demo\jc\swingset2\src\*.java
    marvinrouge

  • FileDialog does not use Windows XP L&F

    Hi,
    Just noticed that when using FileDialog, the buttons, combo boxes & icons along the top row are not displayed in the XP look & feel.
    Here's some sample code to show the problem:
        public static void main(String[] args){
            try{
                Class lafClass = Class.forName(UIManager.getSystemLookAndFeelClassName());
                LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
                UIManager.setLookAndFeel(laf);
                final JFrame frame = new JFrame("FileDialog bug");
                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                JButton b1 = new JButton("JFileChooser");
                b1.addActionListener(new ActionListener(){
                    public void actionPerformed(ActionEvent e){
                        JFileChooser jfc = new JFileChooser("C:\\");
                        jfc.showOpenDialog(frame);
                JButton b2 = new JButton("FileDialog");
                b2.addActionListener(new ActionListener(){
                    public void actionPerformed(ActionEvent e){
                        FileDialog fileChooser = new FileDialog(frame, "Choose file...", FileDialog.LOAD);
                        fileChooser.setVisible(true);
                frame.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
                frame.add(b1);
                frame.add(b2);
                frame.setSize(200, 75);
                frame.setVisible(true);
            catch (Exception e){
                e.printStackTrace();
        }Can someone else please confirm whether or not they see the same problem? I'm JDK 1.5.0_02 under Windows XP SP2.
    TIA,
    James

    If you want Windows XP L & F, you need to add
    public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              catch(Exception e) {
              Login app=new Login();
              app.setSize(400,200);
              app.show();
              app.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
         }//end of mainAdd in this section...
    try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              catch(Exception e) {
              }

  • FileDialog, not JFileChooser, how to set filter? help+help!

    i want to add file filter to the bottom combo box control of FileDialog, but i have no idea.
    1. setFile("*.txt;*.java;") works in a silly style
    2. FilenameFilter doesn't work (return true or false makes no diff from accept function.
    if you used FileDialog before or saw some examples which work well, please give me a hand.
    please don't guess if u never use before.
    many thanks

    setFileNameFilter do not work for Windows 95, 98, or NT 4.0. So better use JFileChooser

Maybe you are looking for