Open a file dialog box using java

Duncan & Frank or anyone
Can you please tell, or give me a link, which explains how to open a file dialog box using java, and not webutil.
I'm trying to read a file on the desktop and update a database table.
Thanks

See Open File Dialog on the WEB... If you can get me the full version numbers I can tell you your supported position.
Regards
Grant

Similar Messages

  • Opening a File Dialog Box

    Hi,
    could somebody help me with how to open a file dialog box.
    I have 1 class which has a window with the relevant widgets on it, I want to be able to click a button on the form and pop up a file chooser form then select a file or type in a new filename and then use the selected filename path in the original form to write data out to the chosen file.
    i understand that i need to use JFileChooser and it will need to be in a new class (like a dialog box would be).
    So basically what i have is 2 classes (the main app and a class called FileOpen.class) so how would i display the fileopen class with the JFileChooser component in it and return what ever is chosen into a string.
    e.g.
    String fileName = <what would go here?>
    kind regards

    thats the example filechooser i have working
    yet when i try and implement it in my program i just get countless exception errors, im not sure if its because my program extends Jframe and not JPanel
    here is my code:-
    package as4;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.util.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class Readap extends JFrame {
    JPanel contentPane;
    GridLayout gridLayout1 = new GridLayout();
    JPanel jPanel3 = new JPanel();
    GridLayout gridLayout3 = new GridLayout();
    JPanel jPanel1 = new JPanel();
    JTextArea txtaStatus = new JTextArea();
    JLabel jLabel1 = new JLabel();
    JTextField txtCon = new JTextField();
    JButton btnConnect = new JButton();
    JTextField txtPort = new JTextField();
    JTextField txtUser = new JTextField();
    GridLayout gridLayout2 = new GridLayout();
    JLabel jLabel6 = new JLabel();
    JPasswordField ptxtPass = new JPasswordField();
    JLabel jLabel5 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JTextField txtHost = new JTextField();
    JPanel jPanel2 = new JPanel();
    JPanel jPanel4 = new JPanel();
    GridLayout gridLayout4 = new GridLayout();
    GridLayout gridLayout5 = new GridLayout();
    JCheckBox chbOracle = new JCheckBox();
    JCheckBox chbOdbc = new JCheckBox();
    JScrollPane jScrollPane1 = new JScrollPane();
    JRadioButton rbtnComma = new JRadioButton();
    JRadioButton rbtnTab = new JRadioButton();
    JRadioButton rbtnSpace = new JRadioButton();
    ButtonGroup delChoice = new ButtonGroup();
    JPanel delPanel = new JPanel();
    JFileChooser fc;
    int dbChoice = 1;
    int conStatus = 0 ;
    String delimiter=",";
    String output="";
    JButton btnClear = new JButton();
    Dbfuncs mydb=new Dbfuncs();
    JPanel jPanel7 = new JPanel();
    JPanel jPanel6 = new JPanel();
    JPanel jPanel5 = new JPanel();
    FlowLayout flowLayout1 = new FlowLayout();
    JButton btnExecute = new JButton();
    JTextField txtQuery = new JTextField();
    JLabel jLabel7 = new JLabel();
    JButton btnOutput = new JButton();
    JLabel jLabel8 = new JLabel();
    GridLayout gridLayout7 = new GridLayout();
    BorderLayout borderLayout1 = new BorderLayout();
    JButton btnExit = new JButton();
    TitledBorder titledBorder1;
    TitledBorder titledBorder2;
    JCheckBox chbQuotes = new JCheckBox();
    JPanel jPanel8 = new JPanel();
    JCheckBox chbHeading = new JCheckBox();
    JPanel jPanel9 = new JPanel();
    ButtonGroup fileChoice = new ButtonGroup();
    JRadioButton rbtnOverwrite = new JRadioButton();
    JRadioButton rbtnAppend = new JRadioButton();
    //Construct the frame
    public Readap() {
    fc = new JFileChooser();
    fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    //setIconImage(Toolkit.getDefaultToolkit().createImage(Readap.class.getResource("[Your Icon]")));
    contentPane = (JPanel) this.getContentPane();
    titledBorder1 = new TitledBorder("");
    titledBorder2 = new TitledBorder("");
    contentPane.setLayout(gridLayout1);
    this.setSize(new Dimension(448, 434));
    this.setTitle("Read Database");
    gridLayout1.setColumns(1);
    gridLayout1.setHgap(2);
    gridLayout1.setRows(2);
    gridLayout1.setVgap(2);
    jPanel3.setLayout(gridLayout3);
    gridLayout3.setColumns(2);
    gridLayout3.setHgap(5);
    gridLayout3.setVgap(5);
    txtaStatus.setFont(new java.awt.Font("Dialog", 0, 10));
    txtaStatus.setBorder(BorderFactory.createLoweredBevelBorder());
    txtaStatus.setEditable(false);
    txtaStatus.setText(">>Program Loaded...");
    txtaStatus.setLineWrap(true);
    txtaStatus.setRows(5);
    txtaStatus.setWrapStyleWord(true);
    jLabel1.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel1.setToolTipText("");
    jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel1.setText("Please choose a database...");
    txtCon.setText("Access");
    btnConnect.setText("Connect");
    btnConnect.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnConnect_actionPerformed(e);
    txtPort.setEnabled(false);
    txtPort.setToolTipText("");
    txtPort.setText("1521");
    gridLayout2.setColumns(2);
    gridLayout2.setHgap(5);
    gridLayout2.setRows(6);
    gridLayout2.setVgap(2);
    jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel6.setText("Password");
    jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel5.setText("Username");
    jLabel4.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel4.setText("ODBC Bridge");
    jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel3.setText("Port");
    jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel2.setText("Host");
    txtHost.setEnabled(false);
    txtHost.setText("alfgar.coventry.ac.uk");
    jPanel2.setLayout(gridLayout2);
    contentPane.setMinimumSize(new Dimension(100, 110));
    jPanel4.setLayout(gridLayout4);
    gridLayout4.setColumns(1);
    gridLayout4.setHgap(2);
    gridLayout4.setRows(3);
    gridLayout4.setVgap(2);
    jPanel1.setLayout(gridLayout5);
    gridLayout5.setColumns(1);
    gridLayout5.setHgap(5);
    gridLayout5.setRows(2);
    gridLayout5.setVgap(5);
    rbtnComma.setText("Comma");
    rbtnComma.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    rbtnComma_actionPerformed(e);
    rbtnTab.setText("Tab");
    rbtnTab.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    rbtnTab_actionPerformed(e);
    rbtnSpace.setText("Space");
    rbtnSpace.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    rbtnSpace_actionPerformed(e);
    rbtnComma.setSelected(true);
    jLabel8.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel8.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel8.setText("Choose Delimiter Type");
    jPanel7.setLayout(gridLayout7);
    gridLayout7.setColumns(1);
    gridLayout7.setRows(6);
    jPanel6.setMinimumSize(new Dimension(434, 45));
    jPanel6.setPreferredSize(new Dimension(434, 45));
    btnExit.setText("Exit");
    btnExit.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnExit_actionPerformed(e);
    jPanel5.setBorder(titledBorder2);
    jPanel5.setMinimumSize(new Dimension(434, 187));
    jPanel3.setBorder(titledBorder1);
    btnExecute.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnExecute_actionPerformed(e);
    chbQuotes.setText("Wrap Data In Quotes");
    chbHeading.setText("Export Column Headings");
    rbtnOverwrite.setSelected(true);
    rbtnOverwrite.setText("Overwrite File");
    rbtnAppend.setText("Append File");
    jPanel7.setBorder(BorderFactory.createLineBorder(Color.black));
    btnOutput.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnOutput_actionPerformed(e);
    delChoice.add(rbtnComma);
    delChoice.add(rbtnTab);
    delChoice.add(rbtnSpace);
    delPanel.add(rbtnComma);
    delPanel.add(rbtnTab);
    delPanel.add(rbtnSpace);
    chbOracle.setAlignmentX((float) 10.0);
    chbOracle.setHorizontalAlignment(SwingConstants.CENTER);
    chbOracle.setText("Oracle");
    chbOracle.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    chbOracle_actionPerformed(e);
    chbOdbc.setAlignmentX((float) 10.0);
    chbOdbc.setHorizontalAlignment(SwingConstants.CENTER);
    chbOdbc.setSelected(true);
    chbOdbc.setText("MS ODBC");
    chbOdbc.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    chbOdbc_actionPerformed(e);
    btnClear.setText("Clear Status");
    btnClear.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnClear_actionPerformed(e);
    jPanel6.setLayout(flowLayout1);
    jPanel5.setLayout(borderLayout1);
    btnExecute.setText("Execute");
    txtQuery.setMinimumSize(new Dimension(280, 21));
    txtQuery.setPreferredSize(new Dimension(285, 21));
    jLabel7.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel7.setText("Enter Query");
    btnOutput.setText("Output To File");
    jPanel3.add(jPanel1, null);
    jPanel1.add(jPanel4, null);
    jPanel4.add(jLabel1, null);
    jPanel4.add(chbOdbc, null);
    jPanel4.add(chbOracle, null);
    jPanel1.add(jScrollPane1, null);
    jScrollPane1.getViewport().add(txtaStatus, null);
    jPanel3.add(jPanel2, null);
    jPanel2.add(jLabel2, null);
    jPanel2.add(txtHost, null);
    jPanel2.add(jLabel3, null);
    jPanel2.add(txtPort, null);
    jPanel2.add(jLabel4, null);
    jPanel2.add(txtCon, null);
    jPanel2.add(jLabel5, null);
    jPanel2.add(txtUser, null);
    jPanel2.add(jLabel6, null);
    jPanel2.add(ptxtPass, null);
    jPanel2.add(btnClear, null);
    jPanel2.add(btnConnect, null);
    jPanel6.add(jLabel7, null);
    jPanel6.add(txtQuery, null);
    jPanel6.add(btnExecute, null);
    jPanel7.add(jLabel8, null);
    jPanel7.add(delPanel, null);
    jPanel7.add(jPanel8, null);
    jPanel8.add(chbQuotes, null);
    jPanel8.add(chbHeading, null);
    jPanel7.add(jPanel9, null);
    jPanel9.add(rbtnOverwrite, null);
    jPanel9.add(rbtnAppend, null);
    jPanel7.add(btnOutput, null);
    jPanel7.add(btnExit, null);
    jPanel5.add(jPanel6, BorderLayout.NORTH);
    jPanel5.add(jPanel7, BorderLayout.SOUTH);
    contentPane.add(jPanel3, null);
    contentPane.add(jPanel5, null);
    fileChoice.add(rbtnOverwrite);
    fileChoice.add(rbtnAppend);
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    public static void main (String arguments[])
    JFrame frame = new Readap();
    WindowListener l = new WindowAdapter()
         public void windowClosing(WindowEvent e)
              System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);
    void chbOracle_actionPerformed(ActionEvent e) {
    dbChoice=0;
    chbOdbc.setSelected(false);
    jLabel4.setText("Conn String");
    txtCon.setText("acal");
    txtCon.setEnabled(true);
    txtPort.setEnabled(true);
    txtHost.setEnabled(true);
    txtaStatus.append("\n>>Oracle Database Selected");
    void chbOdbc_actionPerformed(ActionEvent e) {
    dbChoice=1;
    chbOracle.setSelected(false);
    jLabel4.setText("ODBC Bridge");
    txtCon.setText("Access");
    txtPort.setEnabled(false);
    txtHost.setEnabled(false);
    txtaStatus.append("\n>>MS ODBC Database Selected");
    void btnConnect_actionPerformed(ActionEvent e) {
    if (conStatus==0)
    String url = new String();
    String driver = new String();
    if (dbChoice==0)
    driver="oracle.jdbc.driver.OracleDriver";
    url = "jdbc:oracle:thin:@"+txtHost.getText()+":"+txtPort.getText()+":"+txtCon.getText();
    txtaStatus.append("\n>>Connecting to Oracle Database @ "+url+" via driver:"+driver);
    else
    driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    url = "jdbc:odbc:"+txtCon.getText();
    txtaStatus.append("\n>>Connecting to MS ODBC Database @ "+url+" via driver:"+driver);
    String dbStatus=mydb.openDb(url, driver, txtUser.getText(), ptxtPass.getText());
    txtaStatus.append("\n>>"+dbStatus);
    if (dbStatus=="Connection Successful")
    btnConnect.setText("Disconnect");
    conStatus=1;
    else
    mydb.dbClose();
    txtaStatus.append("\n>>Database Connection Terminated");
    btnConnect.setText("Connect");
    conStatus=0;
    void btnClear_actionPerformed(ActionEvent e) {
    txtaStatus.setText(" ");
    void rbtnComma_actionPerformed(ActionEvent e) {
    delimiter=",";
    void rbtnSpace_actionPerformed(ActionEvent e) {
    delimiter=" ";
    void btnExecute_actionPerformed(ActionEvent e) {
    txtaStatus.append(mydb.runQuery(txtQuery.getText() ) );
    void btnOutput_actionPerformed(ActionEvent e) {
    if (chbHeading.isSelected()==true)
    output=mydb.getAllColName(mydb.getColumnName())+"\n";
    else
    output="";
    Vector mydata=mydb.getResultData();
         int cnt=0;
         for (int index = 0; index < mydata.size(); index++)
              cnt+=1;
              if (cnt>1) output=output+delimiter;
    if (chbQuotes.isSelected()==true)
              output=output+"\""+mydata.elementAt(index)+"\"";
    else
    output=output+mydata.elementAt(index);
              if (cnt>=mydb.getNumCols())
                   output=output+"\n"; cnt=0;
    txtaStatus.append("\n>>"+output);
    int returnVal = fc.showOpenDialog(Readap.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file = fc.getSelectedFile();}
    void rbtnTab_actionPerformed(ActionEvent e) {
    delimiter="\t";
    void btnExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    }

  • 'Open a File' dialog box doesn't show 'Favorites'

    InDesign CS6, Windows 7:
    File/Open gives me this:
    Notice there are no 'Favorites' on the left.  I have to 'browse' for my file each time.  I have a ton of files on the network, and it takes several clicks to get to them.  Annoying when I'm opening several files a day.  The 'Recent Places' isn't too helpful here either.
    Now look at what happens in InDesign CC, Windows 7 with a File/Open:
    Look at all the 'Favorites' and easy browsing on the left side.  Why are the 'Open a File' dialog boxes so different in CS6 and CC?  I want the CS6 'Open' dialog to be just like the CC one.  (I prefer to use CS6, CC is buggy on my system.)

    Not helpful.
    What it is... is cumbersome and un-necessary.  Every other program in Windows  (even Word Pad) opens with the 'standard'  dialog with Favorites on the left.  Why did Adobe program it differently?  There has to be a fix in Preferences or something...

  • Open a File Dialog Box to browse through image files

    Hi all
    I need to develop a code to open a File Dialog Box to browse through Image Files in Oracle 10g.
    Once the Image File is selected i need to save the file in a Table Column in the Backend Table.
    Please help me.
    Thanks
    Nakul Venkatraman

    Hi
    Thanks for your prompt response on this.
    I came across a Sample Form File which would allow the User to browse through files from local PC.
    Following is the code :
    declare
    dirname varchar2(255);
    v_filename varchar2(255);
    begin
         message('1');
    tool_env.getvar('E:\', dirname);
    message('2');
    dirname := dirname || '\project';
    message('3');
    v_filename := get_file_name(dirname,NULL,
    'All Files (*.*)|*.*|' ||
    'JPEG Files (*.jpg)|*.jpg|' ||
    'Bitmap Files (*.bmp)|*.bmp|' ||
    'TIFF Files (*.tif)|*.tif|' ||
    'CompuServe Files (*.gif)|*.gif|' ||
    'PC Paintbrush Files (*.pcx)|*.pcx|' );
    message('4');
    if v_filename is not null then
    read_image_file(v_filename,'ANY','pp_foto.foto');
    end if;
    end;
    The code is written inside WHEN-BUTTON-PRESSED Trigger.
    When i run the form it is not opening the dialog box.
    Please help.
    Regards
    Nakul

  • Open PDF file in linux using java

    Hi..
    How can I open a PDF file in linux using java.
    I am able to open PDF in windows and mac using this code
    in Windows
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + path_of_PDF);
    in mac
    Runtime.getRuntime().exec("open " + path_of_PDF);
    But nothing is working with linux.
    Please help
    Thanks

    appi wrote:
    Hi.. I found the JDIC binary files. There are different binaries for all the plateform. Is there any solution which is independent of plateform.Yes, and we already told you: Use JDK6, which has those libraries built into the standard class library.
    How can I use these binaries in my existing project. does it work, If I place them at same place where other .class files are kept.Read the documentation of the JDIC project. I'm sure they answer this question in their FAQ.

  • InDesign CS6: The "find" function doesn't work in "Open a file" dialog box...

    I am using CS6 on OSX 10.7.5. When I try to search in the OPEN DIALOG box, it NEVER lists anything, not even a close match. If I however search the SEARCH feature on OSX it always finds what I'm looking for. Is there a setting that I have to change to get this to work or is it a glitch? thanks so much!

    Exact same issue here.
    CS6, OSX 10.8.3.
    Example below ("Call Log," third item in first screen shot showing all files on Desktop, does not show up in the "Open a File" search for "Call Log" as shown in second screen shot):

  • InDesign CS6: "find" function doesn't work in "Open a file" dialog box

    in InDesign CS6, "find" function in "Open" dialog box doesn't work. Help?

    Thanks so much!
    I'm using a Mac OS X version 10.7.5. I've been using inDesign for YEARS and depend on that find.
    Any other info you need????

  • Opening a file dialog box with a button while the data graph is running continuos aquisition

    I am running a continuous aquisition that is hardware timed. I display the data on a graph. While running the VI that is displaying the graph I want to open a file to write the data for a period of time then be able to select a new file after the file is written by hitting the open file button again. I also want to just have the file open and after it is opened hit another button that begins the writing to the file.

    To accomplish the first task use a control button, a case structure and a sub vi located inside the case structure. The control button determines the status of the case structure in response to user click. The sub vi writes your data into the file you specified in the file dialog. The entire process repeat itself each time the button is clicked. The set-up of the sub vi depends on organization and type of file you want. I think the second task is just a modification of the first.

  • Open/Save File Dialog Box comes up, then does not respond for a long time or not at all

    I will click a link for a download and the box will pop up saying
    "You have chosen to open "blahblah.blah.blah
    Which is a: blah file
    From: www.randomsite.com
    What should Firefox do with this file?
    Open with
    Save File"
    At this point other than being able to see the box, it is as though it doesn't exist. I can't click okay or cancel or choose what to do. Sometimes after a few minutes it will suddenly work, other times it will just remain until Firefox closes.

    You can also try to clean install the new version after deleting the [http://kb.mozillazine.org/Profile_folder Profile Folder] as well as the [http://kb.mozillazine.org/Installation_directory Installation Folder.] Please see [https://support.mozilla.org/en-US/kb/Backing%20up%20your%20information?s=backup&r=1&e=sph&as=s this] for backing up important info. The '''places.sqlite''' file stores the bookmarks and history, the '''key3.db''' + '''siqnons.sqlite''' files are needed to successfully restore the saved passwords etc.
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Files]
    [https://www.mozilla.org/en-US/firefox/new/ Firefox Latest]

  • When I hit the escape key to close out the open file dialog box, firefox hangs or crashes.

    When I open the "open file" dialog box using the ctrl+O and then hit the escape key to exit the box, I get an error message which I'm not able to paste here.
    it says something about a runtime problem and if I try the same thing again to reproduce the problem, it will sometimes just hang and windows vista will tell me the program is not responding.
    I've checked to see if there are any crash IDs but none were found for this time frame.
    I have even disabled all add ons.
    I'm currently using vista 64 bit edition and Firefox 6, beta edition.

    Hi,
    Please also try right-clicking on the link corresponding to the language version and '''Save Target As''' to save the Firefox installer. If the problem persists, posting [http://answers.microsoft.com/ here] would also be helpful.
    [https://www.mozilla.org/en-US/firefox/all.html Firefox Latest]

  • Open File Dialog Box (JS)

    I know that in order to open a file dialog box and get a file I have to use this code:
    myFile = File(File.openDialog("Import XML","XML Files: *.xml"))
    This is what I use to open XML files. Now I want to be able to open a folder based on the label of the textFrame. I can get the label and build the file path. How can I open a dialog box that already points to a specific folder? Also, how can I check with the script if there are files within the folder?
    Thanks,
    Justin M.

    >How can I open a dialog box that already points to a specific folder?
    var myFolder=Folder("/C/XYZ");
    var myMask="INDD:*.indd";
    var myFile=myFolder.openDlg("Select Files To Open", myMask, true);
    >Also, how can I check with the script if there are files within the folder?
    var myFolder = Folder.selectDialog("Please select path to files");
    if (myFolder!=null) {
    var fileList = myFolder.getFiles();
    alert("The selected folder contains " + fileList.length + " files.");

  • What is the open File Dialog box

    I am using a "File Browse..." item. With firefox a user can click on the provided Browse button or the corresponding text area to choose a file. However with IE7 the file dialog box on appears if the user clicks on the browse button.
    Can someone tell me what javascript can be used to open a file dialog box? (what is called when the browse button is clicked)
    Thanks.

    Thanks Carl,
    I thought APEX was doing some crazy javascropt stuff because I forgot about a style I had set.
    Anyway, I was getting an error if an IE7 user types in a crazy string into the file dialog box and hit submit (since it is not a file). So instead of preventing it I just used a try/catch block in my custom doSubmit. If anyone else runs into this here is a little javascript to help:
    (I am used a uploading image, Carl has an example of that somewhere)
    <pre>
    function doSubmit(r) {
    if (ser_changed.length > 0) {
         if (r == "UPLOAD" || r == "SAVE_CHANGES" {
              flowSelectAll();     
              $x_Value('pRequest',r)
    if (r == "UPLOAD") {
    try {                              /// this is where my fix is.
              document.wwv_flow.submit();
    catch(err) {
    html_HideElement('AjaxLoading');
    alert('Invalid file');
    } else {
    document.wwv_flow.submit();
                   }//save changes and stuff as request.
    else {
              var ans = confirm("You are about to exit the page without saving your changes!" + '\n' + "Click cancel to return to the page.");
              if (ans) {
              flowSelectAll();     
              $x_Value('pRequest',r);     
              document.wwv_flow.submit();
              }//when yes!
    $x('CANCEL_BUTT').disabled=false;
                   }//not save changes and stuff
              }//when there were changes made.
              else {
                             flowSelectAll();     
              $x_Value('pRequest',r);     
              document.wwv_flow.submit();
              }//where there were not changes made
         }//doSubmit
    </pre>
    <pre>
    function html_Submit_Progress(pThis,topass){
              if(pThis.nodeName=='INPUT'){pThis.value='...Loading...'}
    else{pThis.innerHTML='...Loading...'};
              html_ShowElement('AjaxLoading');
    window.setTimeout('$x("wait").src = $x("wait").src', 100);
    doSubmit(topass);
    </pre>
    Edited by: cmorris260 on Sep 19, 2008 3:30 PM
    Edited by: cmorris260 on Sep 19, 2008 3:31 PM

  • File Dialog Box often takes a long time to execute

    Hi all
    The Labview File Dialog Box Express VI sometimes takes 5 to 10 seconds to execute. On other occasions, it executes in a blink of an eye. Why is that so?
    I have tried to use the older Open/Create/Replace File VI as suggested in one of the forum's posts...but it behaves exactly the same way. Another problem is the trimming of the filename, which has also been reported and has NOT YET been solved.
    (By the way...Recently, I updated to LV 2012 SP2 by suggestion of the NI Update Manager, only to find out that I was not entitled to this SP (which apparently only includes bug fixes) and I will have to roll back to LV 2012. Still,  in the evaluation version I can see that the bug is not fixed. Labview must have a lot of serious bugs for NI to ask for a paid bug fix, in which some bugs remain after having been reported a long time ago..well...)
    What worries me now is that intermittent lag in the execution of the File Dialog (such a basic basic function of a program...). Anyone have any idea about this? The support menu said "Ask an engineer"...any of the NI engineers has any suggestion?
    Regards
    Helder
    Attachments:
    FileDialogTest.vi ‏26 KB

    First of all: Thank you very much for the objective answer. I suppose that yor actually ARE a NI engineer, as I had hoped for.
    lease find my comments above (helder---------------------)
    helder wrote:
    The Labview File Dialog Box Express VI sometimes takes 5 to 10 seconds to execute. On other occasions, it executes in a blink of an eye. Why is that so?
    What worries me now is that intermittent lag in the execution of the File Dialog (such a basic basic function of a program...). Anyone have any idea about this?
    The file dialog is provided by the OS, so if it is slow it is not LabVIEW's fault.
    What kind of computer do you have? Is this a laptop that spins down the HD to save power? In this case it needs to wait for the HD to spin up. (You can change the windows power profile or you can spend more money and get an SSD).
    Are you very low on memory?
    Does your LabVIEW program waste 100% CPU in parallel doing nothing due to bad coding?
    Are you pointing to a location that has millions of files?
    Are you pointing to a network location?
    helder:---------------------------------------
    I understand that the File Dialog is provided by the OS. But I have other applications on my PC and this doesn't happen - just in Labview. Sorry! And sometimes it
    doesn't happen. Every 10 times I open the File dialog Box, 5 times it takes long and 5 times it is immediate.
    (I am not low on memory, my coding is not bad>-look at the VI I sent, it just contains the fragment which uses the File Dialog Box and it behaves the same way! I am pointing to the same location that the other applications point to, I am not pointing to a network location, the PC is not spinning the disk down, etc etc.)
    But yes, I will try it on another PC
    (There was another post on the forum on this issue, but can't seem to find it now, just find my own post )
    I attach a video demo of what happens.
    helder wrote:
    Another problem is the trimming of the filename, which has also been reported and has NOT YET been solved.
    What problem is that? Can you elaborate? There is a known bug in the windows dialog box that sometimes the pre-filled file names are shifted and not fully visible. This is a windows bug documented by Microsoft and LabVIEW has no control over it. It is not NIs job to fix OS problems.
    helder:-------------------------------------------
    Of course you can't fix the OS.
    If it is a windows bug, we will have to live with it.
    A previous post on your forum did not provide me with that information (http://forums.ni.com/t5/LabVIEW/File-dialog-trimmi​ng-the-default-name/td-p/2189874). The fact that it is a windows bug was not mentioned there. 
    helder wrote:
    Hi all
    (By the way...Recently, I updated to LV 2012 SP2 by suggestion of the NI Update Manager, only to find out that I was not entitled to this SP (which apparently only includes bug fixes) and I will have to roll back to LV 2012. Still,  in the evaluation version I can see that the bug is not fixed.
    Patches are included, service packs are not included. I think this is well documented. Most users are on SSP, this way you are always entitled to the newest version.
    As with anything else, software has bugs. It is impossible to test a huge, complex system like LabVIEW under all scenarios. The possible number of combinations of hardware and other installed software on any particular computer probably exceeds the number of atoms in the universe. It is actually amazing how few bugs there are and how well it works. What "bug" are you talking about? Bugs are prioritized according to rules. Critical bugs are typically fixed very quickly. A cosmetic issue that only affects you and nobody else will take longer or might not even get fixed. Are you talking about a confirmed bug that could be reproduced by NI? Do you have a CAR#?
    helder:----------------------------------------
    I was referring to the file-name-shifting-cosmetic-bug that the October-2012 post had indicated. But if it is a Windows-bug, NI does not have any responsibility, of
    course.
    Regarding the bugs, of course they are unavoidable.
    helder wrote:
    Labview must have a lot of serious bugs for NI to ask for a paid bug fix, in which some bugs remain after having been reported a long time ago..well...)
    That sentence makes no sense! Why would the number of serious bugs depend on the cost of upgrading?? You are just rambling here....
    In an ideal world, NI would have an unlimited number of programmers that can work 24/7 to immediately fix any discovered bug. This would only be possible if all users are willing to pay an unlimited amount of money for the software. As I mentioned, bug fixes are free in the form of patches, and they come out regularly. Service packs include new features and are not free.
    helder:---------------------------------------
    "....include new features"..????
    ---->>From http://www.ni.com/labview/release-details/
    "LabVIEW 2012 Service Pack 1 is an exclusive update to LabVIEW 2012 for NI Standard Service Program (SSP) customers. There are no new product features introduced in service pack releases; instead, these releases provide bug fixes and improved stability for LabVIEW 2012. For a list of these bug fixes, click here."
    No new features, just bug fixes!"
    Moreover: If it isn't free, it shouldn' have let me update if I am not a SSP costumer.
    Now I have a 45 days evaluation version. After that, I have to uninstall and reinstall everything.That takes some time and effort.
    If there is a more direct way of rolling back t the previous version, please let me know.
    Thank you

  • File Dialog Box Position

    Hi there,
    I've been unable to find anyone else mention this problem, but then again, I'm not exactly what to search for.
    Since installing Lion, I've had a problem where when I try to open the file dialog box to save or open a file, it's position is always further down.  This is annoying, especially for programs that open files from my Download folder, which is continuinally growing as I add more stuff.  The sort on this is by date, and so usually I want to open the most recently downloaded file, which I have to scroll further and further up each time.
    Is there any way I can get it to jump to the top?
    See the attached image to see what I mean exactly.
    Thanks!

    the length of the session is not the problem. it is set to 50bpm at 29.97 drop frame which gives me 2138 bars at 3 hours 51 minutes record time. I only used 1896 bars at 2.5 hours to record the program and there were only 5 tracks recorded. the problem starts when I try to bounce the session to an interleaved stereo file either online or offline. a dialog window says it will exceed 2gigs and prevents me from performing the bounce. only when I select split stereo instead of interleaved within the bounce window does it let me bounce. I think it is because the 2 resulting mono files(left and right)are each less than 2gigs. Is there a limit to the file size you can create when bouncing?
    a 2gig file sounds small to me when there are video files much larger within video editing software.

  • File Dialog's using Remote Panels (via web server)

    I am aware that the web server remote panel access will not allow us to open a file dialog box on a remote computer.  I have read people comment that you should create your own file dialog box, using LabVIEW to use instead of the file dialog box.
    Has anyone actually done this?  I would like know if anybody has source code for this, rather than re-inventing the wheel.  Also, will the sub-vi actually just appear on the webserver? i.e. will it actually work?
    Thanks for any help
    Slade

    Hi Emilie,
    I have a program that I run on an industrial PC, with no keyboard, video or mouse.  We currently control the application using the web server.  We have a button to load and a button to save settings.  If the files are missing for the load & save, it pops up a file open dialog to choose the file to import.  However, while we are viewing the page this way, these dialog boxes do not work.
    I would like to know if anyone has made up a file dialog box that I could use, that would display correctly in the web server's remote control.
    Regards,
    Slade

Maybe you are looking for

  • Can no longer digitally sign PDF's with Adobe Reader 9

    On our government network some of us have been upgraded to Adobe Reader 9 but now we can no longer digitally sign some PDF files. People with Adobe Reader or Pro 8 can. Here is a link to one of the documents: www.unl.edu/nrotc/Nc3065.pdf I'm also att

  • Import package with .* in jsp

    If i want to use HashMap in jsp page i need to have HashMap of util package in import statment in page directive. What is difference in Using a) <%@ page import="java.util.HashMap"%> b) <%@ page import="java.util.*"%> Is there any performance issue u

  • ICal won't sync with PalmZ22 in 10.5.1

    Before I upgraded to Leopard iCal I synched fine with Palm z22 now it won't. By removing "Apple Conduit" from conduit folder and replacing it with 'Calendar Conduit", I can now synch with Palm desktop. I would prefer to use iCal. Is this a Leopard bu

  • Multiple button selection in spark ButtonBar

    Is it possbile without too much hacking to add an ability to select several buttons in <s:ButtonBar/> controll >? Thanks

  • Importing AVCHD from Memory Stick

    Hi- At work I've been going through the delightful experience known as AVCHD *$%!...thought I had my head around it and a plan of attack decided (sadly, I was going to suck it up and use a PC, so I could drag and drop files) when I relized my PC didn