?
Solved

Im trying to write an applet with JFileChooser, so the user can browse the harddrive and click on a file as input

Posted on 2003-03-12
1
Medium Priority
?
196 Views
Last Modified: 2010-03-31
I have an applet written that allows the user to type the input, the input is then used to parse a file.  I need to have the user to be able to browse for a file on the hard drive, and this then to be used again as input to be parsed. When I try this I get various security issues. Would it be possible for  someone to give me some advice on how to go about this.

Thankyou.


import java.awt.*;

//-------------------------------------------------------------------
//  Main applet class

public class FileApplet extends java.applet.Applet {

  public void init() {
   
     add(new Button("Load File"));
 
  }//init

  public boolean action(Event x,Object arg) {
   
     if (x.target instanceof Button && ((String)arg).equals("Load File")) {
            ParsePDB pPDB = new ParsePDB();
            pPDB.other();
     }//if
     return true;
  }//action

  //  These methods allow the applet to also run as an application.

  public static void main(String args[]) {
   
            ParseFile pFILE = new ParseFile();
            pFILE.another();
     
  }//main
 
}//FileApplet
0
Comment
Question by:petede
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
CEHJ earned 1500 total points
ID: 8119161
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question