Browse and dispaly

Hi,
I am trying to create a gui where I can browse on my desktop and load a file from there to take it to the server. Below I have taken a snipet of the code where I browse on my desktop, but my problem is this is not displayed in the textfield...(and I have tried searching ways on the internet how this can be done but to no avail I couldn't find anything that made sense to me). In addition, the output statement I have inserted for debugging purposes just gives me the file (not the full path, etc I get You chose to open file: sample.txt, and I would like to see You chose to open file : C://Documents and Setitngs/ Desktop/ ... /sample.txt. ) and I am trying to get this displayed on the text field whereby I can add it onto a list that is below it and when I click Add and Done, the server can pull these files from my machine to it...
//Browse Button
          JButton button_Browse = new JButton ("Browse");
          c.gridx = 2;
          c.gridy = 3;
          button_Browse.addActionListener(new ActionListener()
          private Component parent;
                         public void actionPerformed(ActionEvent ae)
                         String command = ae.getActionCommand();
                         System.out.println("Browse for Document to Add");
                         JFileChooser choose = new JFileChooser();
                         int returnVal = choose.showOpenDialog(parent);
                         System.out.println("RETURN VALUE IS:"+ returnVal);
                         if(returnVal == JFileChooser.APPROVE_OPTION)
                                   String filename = choose.getSelectedFile().getName();
                                   System.out.println(filename);
                                   System.out.println("You chose to open file: "+ filename);
                                   //Display Document in path textfield
                         /* Filter out all file types but text file [to do later]
                         .... more code to this
               });

more to it for the doc list
          private static void initializeDocList() {
     // TODO: Dynamically retrieve the list of project names
               //client.SessionManager.getProjectList();
          String[] DocNames = { "Doc1", "Doc2", "Doc3", "Doc4", "Doc5" };
          JList DocList = new JList(DocNames);
          DocList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
          DocList.setLayoutOrientation(JList.VERTICAL);
          DocList.setVisibleRowCount(-1);
          DocList.addMouseListener(new MouseAdapter() {
               public void mouseClicked(MouseEvent me) {
                    System.out.println( "Document to add is selected");
          DocListScroller = new JScrollPane(DocList);
          DocListScroller.setPreferredSize(new Dimension(400, 300));
          }

Similar Messages

  • Open and dispaly XL file in IE with java

    Hi all,
    I need to display XL file in the browser.
    Here the problem is,In JSP I am providing one link, After clicking the ling I have to create one XL file and dispaly the XL file(open and display) with out clicking another link or button.
    I wrote one action to create one XL file(after clicking the link it will come to action). Here I am creating XL file and storing the file. Here I need to displai the XL file in the browser with clicking another button or link.
    <b>In single click only I have to create the file and disply the XL file.</b>
    waiting for solution............
    Thanks & Regards
    Rama Krishnam Raju

    Hi,
    pls see the code what I worte in jsp is
    <b><% String filepath=(String)request.getAttribute("url");%>
    <title>My JSP 'Dispaly.jsp' starting page</title>
    <meta http-equiv="refresh" content="10;URL='<%=filepath %>' "> (here file path is "Registrationdata/Registrationdata22-7-106-1156254077328.xls")</b>
    it is printing the data in browser as follows instead opening the spreadsheet.
    <b>UM_User_id, UM_First_Name, UM_Middle_Name, UM_Last_Name, UM_Dept_Name, UM_City, UM_Primary_Email, UM_Created_On, No.of BPs Uploaded, UM_Status, UM_isValidDomain 1, rama , rao , n , Force ITES , hyd , [email protected] , 2006-08-11 12:47:00.0 , 2 , Pending , Yes 2, karri , rama , reddy , yahoo , sec , [email protected] , 2006-08-11 12:47:00.0 , 2 , Pending , Yes 3, rama , krishnam , raju , yahoo , hyd , [email protected] , 2006-08-11 12:47:00.0 , 0 , Pending , No 4, rakesh , rww , rak , computers , hyd , [email protected] , 2006-08-11 12:47:00.0 , 1 , Inactive , No 5, hemanth , h , n , electronics , sec , [email protected] , 2006-08-14 10:46:07.0 , 2 , Inactive , Yes 6, jagadish , mid , J , forceites , bombay , [email protected] , 2006-08-22 13:33:33.0 , 0 , Active ,No 7, XYZ , Y , Z , gmail , calcutta , [email protected] , 2006-08-17 18:26:55.0 , 0 , Inactive , No</b>
    It is not opening the spreadsheet but it is printing the data.
    I need to open the spreadsheet on the browser with the data.
    <b>Browser settings also I checked.</b>
    kindly solve my prob.
    Thanks & Regards
    Rama

  • I cannot open photos in my Photoshop CS 6.  I have been able to open Browser and Camera Raw, but not

    I cannotg open photos in Photgoshop CS6.  I can open them in Photoshop Browser and Camera Raw, but cannotg open them in Photoshop.  Blue circle comes on for about three seconds, then changes to a plus sign, and nothing else happens.  Please help.  Adobe Photoshop is either unwilling or unable to help me with this problem.

    Nobody can help you without some exact system info and details on what photos exactly.
    Mylenium

  • Adobe Muse: "Preview page in browser" and "preview site in browser" functions have stopped working.

    Working one day then not the next. Firefox just spins. The preview button works, as does the publish function.
    2.7Ghz i7 Macbook Pro with Retina Display
    Muse 2014.0.1
    Something else to add: When Firefox finally timed out it displayed the full url. Copying and pasting that into Safari and everything works. So it seems in someway this is a Firefox issue or a Muse -Firefox connection issue.
    So the new question is: how can I change the browser Muse chooses to use when I select these two functions?

    HI,
    Adobe Muse will use OS default browser for preview the page/site in browser. So you can change the default browser and preview the site again.
    Also, try to troubleshoot Firefox, using their official documentation
    Firefox can't load websites but other browsers can | Firefox Help
    Do let me know if you have any question.

  • Browse and Edit Form - JSP

    Hi all,
    Using BC4J and BC4J JSP to generate Browse and Edit Form, e.g. EmpView_browse.jsp, and EmpView_Edit.jsp, I want to show only a few attributes in browse, and all fields in edit. If I change the "display" in control hint to hide, the attribute will not be displayed in both pages.
    Please help.
    Regards,
    Terry Luk

    Hi,
    try something like this :
    <jbo:ViewObject id="voBrowse" name='<%=dsParam%>' />
    <jbo:AttributeIterate id="df" datasource="<%=dsParam%>">
    <% if (df.getName() == "InvoiceNr") {
    <th class="clsTableHeader" title="<jbo:ShowHint hintname='TOOLTIP'></jbo:ShowHint>" ><jbo:ShowHint hintname="LABEL"></jbo:ShowHint></th>
    <% }%>
    </jbo:AttributeIterate>
    <jbo:RowsetIterate datasource="<%=dsParam%>" changecurrentrow="false" userange="true">
    <tr>
    <jbo:AttributeIterate id="dfv" datasource="<%=dsParam%>">
    <% if (dfv.getName() == "InvoiceNr") {
    <td title="<jbo:ShowHint hintname='TOOLTIP'></jbo:ShowHint>" valign="top" > <jbo:RenderValue datasource="<%=dsParam%>"/> </td>
    <% } %>
    </jbo:AttributeIterate>
    </tr>
    </jbo:RowsetIterate>

  • Browse and Upload

    Hey guys,
    Im trying to create a browse and upload interface on my website but to no avail. Creating the buttons worked; but making them do what they are suppose to do doesnt. For example, i created a Browse and Upload button. The browse button would search for the file, but the upload button do nothing at all. How do i enable upload to work? Can it be done by html coding? Is it some settings that must be enabled on the server itself?
    Thanks!

    I don't think I quite understand what you are trying to do? You created a browse function, do you mean search function so you can search for something on your website? Also is the upload function so people can upload content to your server?
    To get the upload function to work you will need a lot more than just simple html. Html is not a programming language it is a markup language that just tells the browse what to show. You would need PHP or JS to get an upload function to work with your server.
    I bet there are a ton of tutorials on youtube. Try searching for 'how to create an upload function on my website'.
    This is beyond what Muse can do. I hope I understood what you were asking. If not please give me more details.

  • Browse and upload file - Forms(6i)

    Hi Friends,
    How to enable users to browse and select a file from their local machine in a D2K forms (6i) and upload to the database unix directory
    Thanks
    Ramya

    Hi Friends,
    my exact requirement -
    I have a form with 2 buttons -
    First Button -
    I have to create a external table,the file that is associated with external table is browsed in the form through button,after the file is browsed ,the same file has to be placed in unix directory.
    Second button -
    This button is to execute a packaged procedure which will be using the data from the file associated with the external table that we placed in the unix directory ( which i explained under button1)
    Thanks
    Ramya

  • Browse and Open  an Image from a phone,  save too

    can anyone tell me how to browse and open an image from the phone and then save that image with different name?

    you only have access to file fia the File Connection API, otherwise you can just read it from your jar, not writ or change the name.

  • I did a refresh on my Fire fox browser and now I can't print anything. Help!

    Browser was hanging up and issuing a not responding message. this would last for a good period of time. then all of a sudden it would load my home page of Yahoo.
    Did a refresh of the browser and it solved the slowness of the page loading, but when I went to print a page everything would work until i actually clicked on the print button and a box came up telling me firefox had crashed and would send out a report. This happened after the browser refresh. Did something get removed so the browser doesn't recognize the printer? How do I solve this problem?

    hello, could you provide your latest few submitted crash reports? please enter '''about:crashes''' into the location bar, copy the latest few report ids from there starting with '''bp-''' & paste them here into a forum reply. this will give us a better understanding what may be triggering those crashes.

  • I've installed the Adobe Reader Plug In. Yet every time I click to see a PDF, it opens another browser and it is blank. The Browser reads about:blank. How can I fix this so that PDF's open in the browser?

    I've installed the Adobe Reader Plug In. Yet every time I click to see a PDF, it opens another browser and it is blank. The Browser reads about:blank. How can I fix this so that PDF's open in the browser?

    Check your settings in Options > Applications: https://support.mozilla.com/en-US/kb/Opening%20PDF%20files%20within%20Firefox#w_check-firefox-settings
    Also see:
    *https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox
    *http://kb.mozillazine.org/File_types_and_download_actions
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]

  • I used to be able to close the browser and still have the download box open and still download stuff but now I can't...what happened???!!!

    I was in the process of downloading something tonight and decided to close my browser. Unfortunately, the download window also closed and that meant my download was gone and I would have to start over again.
    I went back and started the download again and the download box showed the file picked up where it left off but when I closed the browser the same thing happened again; the download box closed when I closed the browser.
    The reason I close the browser is because my downloads download faster when the browser is closed and now that option is closed to me.
    Is this a new feature if so I don't like it as a matter of fact I would say I'm very pissed off with this new development. Please go back to fixing it so I can close the browser and still download.

    Hi cor-el:
    Thanks for responding to my post.
    I went to about:config like you suggest and changed the the thing you said. There is no improvement. Instead of my browser and the download box closing when I click on exit button/link now a box pops up with the message "If you exit now, 1 download will be canceled. Are you sure you want to exit?
    I don't need a box to warn me that if I exit that the downloads manager would close as well...I already know that and that's the problem. I want a way to stop the download manager box from closing when I exit the browser like it used to.
    Thanks anyway.

  • Unable to open PWA in browser and MSP on application server in project server 2007. ERROR: Sending the Soap message failed or no recognizable response was received.

    Hi All,
    I am using project server 2007 and WSS 3.0. 
    I have been facing a strange issue for couple of days. I am unable to open PWA in browser and MS Project Pro on application server.
    Everything is correct whether it is URL or MS Project profile account on MSP.  This is strange because i can open same PWA/MSP from other computers (Database server / Client PCs) but not locally on server.
    When i try to connect to MSP on App server, i get the following errors in event viewer.
    Event Type: Error
    Event Source: MSSOAP
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description:
    Soap error: Connection time out..
    Event Type: Error
    Event Source: MSSOAP
    Event Category: Client 
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description:
    Soap error: An unanticipated error occurred during the processing of this request..
    Event Type: Error
    Event Source: MSSOAP
    Event Category: Client 
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description: Soap error: Sending the Soap message failed or no recognizable response was received.
    Event Type: Error
    Event Source: MSSOAP
    Event Category: Client 
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description:
    Soap error: Unspecified client error..
    One more issue i am facing and i guess that is related to above issue. The Issue is, when i am creating a new project, It's workspace gets created but doesn't get linked to the project and i can't link it manually because it already exists for the project.
    sandeep

    Hi Paul ,
    Thanks for reply. The project server URL was already added to the Trusted
    Sites/Local Intranet areas in IE. 
    sandeep

  • This message keeps coming up when I log in to my email ---In order to use Yahoo Mail, please turn Private Browsing off. Please go to Settings » Safari » Private Browsing, and turn it off

    this message keeps coming up each time we try to log in to our email. In order to use Yahoo Mail, please turn Private Browsing off. Please go to Settings » Safari » Private Browsing, and turn it off"
    I have gone to settings but you cannot turn off the private browsing anywhere
    can someone help,us out?
    thanks

    You turn private browsing off on the Safari page. Tap the + sign in the upper right corner, then tap private in the lower left corner. You know you're in private when the top of the screen is dark.

  • TS1398 my problem is my iphone 4s is connected to the internet(wi-fi) with full signal strength but freezes when browsing and says "Cannot Open Page, Safari could not open page because the server stopped responding".

    my problem is my iphone 4s is connected to wi-fi with full signal(3 bars) strength but freezes when browsing and says
    "Cannot Open Page"
    "Safari could not open page because the server stopped responding"
    I already reset the iphone to its factory settings and erase all contents but still the browsing speed freezes or not searching at all. Sometimes it will work and fast but then the problem uccors every now and then. Iv'e been using iphone 4 for two years and I still have it and works fine compared to this IPHONE 4S.

    Settings → scroll down to Safari → in Safari settings, I selected both Clear History and Clear Cookies and Data.
    IF that does not work -
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    Finally - if problem still present -
    Go to Settings>General>Reset
         Reset the network settings - you will need to add the password of your home WiFi in your phone once more
    The device should turn itself off & back on then go into Settings>Wifi and join your network

  • Safari won't open pictures on imgur. To test used another browser and it showed them

    Safari won't open pictures on imgur. To test used another browser and it showed them
    Here is the page was trying to surf  http://imgur.com/gallery/n9Bjm

    From the Safari menu bar, select
    Safari ▹ Preferences... ▹ Extensions
    Turn all extensions OFF and test. If the problem is resolved, turn extensions back ON and then disable them one or a few at a time until you find the culprit.

Maybe you are looking for