Placing properties file

wls 6.1sp4
WebApp in WAR format contains a servlet which loads on startup. This servlets
has to load some properties file. Currently if i have this properties file in
system classpath. Servlet is able to find. I dont want to place my properties
file in system classpath.
i tried placing in web-inf/classes and checked preferwebinf classes. But still
no luck. when servlet is loaded and trying to find the resource bundle..it is
unable to find it.
any pointers will be appreciated very much.

Copy resource bundle of the default locale to the web-inf/lib directory.
ResourceBundle resourceBundle=
ResourceBundle.getBundle(myResourcesFile, Locale.getDefault(), getClass().getClassLoader());
"yo" <[email protected]> wrote:
>
"Deepak Vohra" <[email protected]> wrote:
Get properties file with the getResourceAsStream() method.
Copy properties file in the WEB-INF/classes directory.
InputStream inputStream =
getClass().getClassloader().getResourceAsStream("servlet_properties.properties");
props.load( inputStream );
I forgot to mention that it is not properties file. it is resouce bundle.
I have
place resournce bundle in web-inf/classes folder.
in my servlet, im using
ResourceBundle.getBundle(myResourcesFile, Locale.getDefault(), getClass().getClassLoad());
but im getting
MissingResourceException
any pointers
>
"yo" <[email protected]> wrote:
wls 6.1sp4
WebApp in WAR format contains a servlet which loads on startup. This
servlets
has to load some properties file. Currently if i have this properties
file in
system classpath. Servlet is able to find. I dont want to place my
properties
file in system classpath.
i tried placing in web-inf/classes and checked preferwebinf classes.
But still
no luck. when servlet is loaded and trying to find the resource bundle..it
is
unable to find it.
any pointers will be appreciated very much.

Similar Messages

  • Problem with placing of properties file

    Hi all,
    Iam using a properties file.
    From a jsp, Iam reading the property file.....
    Its giving FileNotFoundException....
    I hope its problem with placing of my properties file...
    I placed the properties file in WEB-INF/classes..folder.....
    But still iam getting the FileNotFoundException...
    PLz tell me where exactly should I place my properties file...
    Thanks ....

    first rule of using a forum: read recent topics !
    http://forum.java.sun.com/thread.jspa?threadID=668488&tstart=0

  • Deploying properties files outside of the web application in WebLogic 8.1

    Hi
              I am wondering if it is possible to deploy a web application and place configuration files (properties files, log4j xml files etc...) in a folder somewhere within WebLogic that is on the Server instance classpath. This would allow me to edit the config files and restart the server without having to hack into the web application .war file and then redeploy.
              I am really looking for an equivalent of the /applib folder in Oracle 10gAS (each OC4J server instance has an /applib folder which is on the classpath of the server).
              Is there an equivalent for a weblogic server instance?? (i.e. not just for the entire weblogic server but for individual sever instances).
              thanks
              Will

    WLS 9.2 includes pretty advanced features in this area. Both deployment plans and application libraries could be used. There's also a domain/lib directory where jar files can be placed and are visible throughout the server instance.
              Unfortunately 8.1 has none of these features. In 8.1, your choices are to either add these into the $CLASSPATH, or package them in the application.
              -- Rob
              WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • How to give Path for a properties file

    Hi,
    I am using a SQL.properties file to load all my SQL statements to my EJB JDBC prepared Statement. I have placed the SQL.properties file in com.company.sql package. I have another SQL class in the same package which is loading the SQL.properties file to cache for future use. I am using the path as "SQL.properties" (the file name straight ) in the SQL class to access the properties file.
    I am using Sun App Server 7. To get access to this file I need to copy the SQL.properties file to the config directory of the app server instance. Otherwise it is not able to locate the file. I don't want to put the properties file in the config directory of the app server instance. Please help me, what path I have to give to access the file from the package itself, rather from the config directory of server instance.
    I think , some one who is doing localization can help me out here. They have to put the localized properties file to access the text out of it. Please help me. Thanks in advance.
    Thanks
    Amit

    You can use ResourceBundle class to load this properties file from the classpath:
    ResourceBundle props = null;
    props = ResourceBundle.getBundle("com.company.sql.SQL");

  • Use of properties file

    I need to connect to a database I have specified the driver class and url in a .properties file, I have placed this .properties file in the classes folder of WEB-INF
    once i create the war file and sent it to the client, They need to change the url but since we are delivering a war file they cannot do it. How can i achieve this?

    Use a JNDI datasource so that your code doesn't make a connection to the database but uses JNDI to locate the datasource. Then the client only has to create the datasource at the server level and assign it to the JNDI name.

  • Reading a properties file in a servlet and passing its contents to a JSP pa

    Hi all,
    I'm totally new to Servlet pgmg n JSP. Please can ne1 tell how to read a simple properties file (in a servlet) and pass its contents to a JSP page.Actually the reason is to fill a combo box in a JSP page with the contents of a properties file.If calling a servlet for the same is d best way to do that, plz can ne1 tell me :
    1> whether to override the doPost method in the servlet in which to read d file using FileInputStream
    2> Putting the contents in an array and then how to pass this array to the JSP page.
    Thanks,
    deepthy.

    I'm using a properties file to let my web application know what the name of the database is. I'm using an abstract class GeneralDao which will be extended by all the DAO's (Data Access Objects or java classes containing SQL statements).
    Here's the code :
    protected Connection getDatabaseConnection()
              throws Melding
         Connection dbconn = null;     
         ResourceBundle resBundle;
         try
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         resBundle = ResourceBundle.getBundle("gcoConfig");
         String dbConnectie = resBundle.getString("databaseconnection");
         gcoLogger.debug("lezen databaseconnection in resourceBundle " );
         dbconn = DriverManager.getConnection(dbConnectie);
         } catch (InstantiationException exc)The ResourceBundle is used to read the properties file, named gcoConfig.properties.
    With the getString() command I read the content of the string named databaseconnection.
    The gcoConfig.properties file is placed inside the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes
    The GeneralDao is placed in the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes\org\gertcuppens\cluifDao.
    So this class is placed some folder below the WEB-INF\classes folder of gcoConfig.properties.
    And the content of the properties file is just one line :
    databaseconnection=jdbc:mysql://localhost/cluif
    If you want to let the JSP know what's inside the properties file, wrap the content in a Javabean, put it in the request or even the session and pass the control to the JSP.

  • Format Text in properties File

    I have a large amount of text for an element in the properties file that I'd like to format. I'm retrieving this value and displaying it in the tip of a panelLabelAndMessage ADF component. For example, in the properties file I have the following:
    displayparagraph=This is the first paragraph.This is a second paragraph I'd like on a new line.
    I'd like this text to be broken apart onto new lines when it displays in the tip element, like this:
    This is the first paragraph.
    This is the second paragraph I'd like on a new line.
    I'm not sure how to go about doing this or if it's even possible. I've tried placing \n, \\n, \r, \r\n, etc...inbetween the "." and "This" but this doesn't appear to work.
    I'd also like to a portion of that same message be underlined as a link...not sure if that is possible either.
    I have to keep the text in the properties file for translation purposes and I can't really break up the sentences into seperate elements to ensure that translations doesn't lose the meaning of the tip.

    Hi,
    If you set the escape property to false on your output components you can put HTML code in your properties file for the components that you want to format differently.
    Not all components can do this but the key ones like OutputText do.
    regards,
    Brenden

  • Update placed PDF files to recognize transparency

    I have used Croptima InPlate to create an imposed cut and stack imposition of a large 3800 variable data project. Due to the size of the file, I've only imposed the black plate variable data. I want to use Acrobat's add background tool to add an imposed master graphic of the rest of the file image (the black-only variable text will overlay the other elements).
    Croptima has done a great job with the imposition, however it has placed all the files in the layout with a white backround (not transparent as is resident in the source PDF file. When I try to add the main background in Acrobat the white boxes from the PDF mask out the background image. I can manually remove the boxes in Acrobat one at a time, but doing this across a 6-up, 640 page document makes for quite the undertaking.
    My question is if there's a way in InDesign to update all placed PDF files to display with a transparent background instead of the opaque background.
    The relink feature with import option won't do it document wide, it wants to individually prompt for every graphic and won't retain the page assignments.
    I found a script on the forum which will update each link to a transparent background individually, but I have to manually enter in each page number of the imposed PDF ... also a huge time suck.
    Does anyone know of a way to change the placement properties document-wide of a single, multi-page placed PDF to a transparent background instead of opaque?
    Or... does anyone know how to get Croptima InPlate to place PDF files with a transparent option?
    Thanks in advance.

    I had to chime in:
    First to help out if BLUDVLZ24 would like to test drive Quite Imposing Plus.
    Here is a temporary number so you can test drive it yourself. Just go yo our site www.quite.com and download QIP and use the following Serial number and private code.
    Quite Imposing Plus V1/V2
      Expires end 3/2010  Serial 0783-6227-0032-4682  Code 6826
    Second to help out Mr. Met:
    If you have any trouble understanding Quite Imposing Plus you should have emailed us at [email protected] we would have been happy to help.
    Also, there is a Getting Started tech sheet within the program (instead of reading the entire manual - which may have caused your dislike of QIP)
    Once loaded, please Check out Getting Started tech sheet. Go to our Imposition Control Panel and click on the ? button.....
    then click the Getting Started button.Also, lots of good information on signature setups Step-by-step Instructions and New features.
    Also, take a look at www.quite.com/imposing/techsheet too-it has some other tech step by step sheets - note: cut-stacks tech sheet is there for you to look at. 
    cheers,
    Charles
    Charles James
    Technical/Marketing Director
    Quite Software
    USA
    858.581.9143
    [email protected]
    www.quite.com

  • WEB-INF and properties files

    okay, this may be really naive and maybe i'm missing some key piece of
    documentation, but i'm missing something regarding the file structure with
    iplanet enterprise 4.1 on solaris.
    in my /usr/local/netscape/suitespot there's a docs directory that is the
    default docs directory.
    I've created a /WEB-INF directory under docs and a /classes directory under
    that. I've placed a jay.properties file in the /WEB-INF/classes directory,
    but when I try to access that through a servlet instantiated bean, I get an
    error from the ResourceBundle call, telling me that it can't load that
    properties file.
    I have two questions:
    1. did i build the WEB-INF directory in the correct place (ie - is this the
    standard way of working under the iplanet server) - this doesn't seem to be
    supported by the admin server in the sense that i can browse this directory,
    when i'd expect that iplanet would build in some basic security around the
    WEB-INF directory
    2. what do i name and where do i put the properties file? should it be
    jay_en.properties? i've tried a number of different scenarios with no luck.
    thanks...
    jay

    Why would you create a WEB-INF directory on the web tier?
    WEB-INF is a directory with a special meaning to the web container. All
    of your properties files and such will need to be placed on the
    application server tier, in the WEB-INF directory that was automatically
    created there. And you can do that just be properly placing them in the
    WAR file.
    David
    Jay Wright wrote:
    > okay, this may be really naive and maybe i'm missing some key piece
    > of documentation, but i'm missing something regarding the file
    > structure with iplanet enterprise 4.1 on solaris.
    >
    > in my /usr/local/netscape/suitespot there's a docs directory that is
    > the default docs directory.
    >
    > I've created a /WEB-INF directory under docs and a /classes
    > directory under that. I've placed a jay.properties file in the
    > /WEB-INF/classes directory, but when I try to access that through a
    > servlet instantiated bean, I get an error from the ResourceBundle
    > call, telling me that it can't load that properties file.
    >
    > I have two questions: 1. did i build the WEB-INF directory in the
    > correct place (ie - is this the standard way of working under the
    > iplanet server) - this doesn't seem to be supported by the admin
    > server in the sense that i can browse this directory, when i'd
    > expect that iplanet would build in some basic security around the WEB-INF
    > directory
    >
    > 2. what do i name and where do i put the properties file? should it
    > be jay_en.properties? i've tried a number of different scenarios
    > with no luck.
    >
    > thanks... jay
    >
    >
    >

  • How to set Path for a properties file

    Hi,
    I am using a SQL.properties file to load all my SQL statements to my EJB JDBC prepared Statement. I have placed the SQL.properties file in com.company.sql package. I have another SQL class in the same package which is loading the SQL.properties file to cache for future use. I am using the path as "SQL.properties" (the file name straight ) in the SQL class to access the properties file.
    I am using Sun App Server 7. To get access to this file I need to copy the SQL.properties file to the config directory of the app server instance. Otherwise it is not able to locate the file. I don't want to put the properties file in the config directory of the app server instance. Please help me, what path I have to give to access the file from the package itself, rather from the config directory of server instance.
    I think , some one who is doing localization can help me out here. They have to put the localized properties file to access the text out of it. Please help me. Thanks in advance.
    Thanks
    Amit

    I am using the propeties file to get the SQL statements. I have all the SQL query statement in the properties file. I am creating a preparedstatement after getting the statement from the properties file with the id like we do in ResourceBundle. If I keep the properties file in the config directory of the Sun App Server instance , then it is working fine. But If I don't keep it there, then it is giving me a file not found exception.
    My SQL class which is accessing the properties file are in same package (com.company.sql). But still it is not able to find the file. As suggested by you, I tried it by giving the path as com.company.sql.SQL. Still it did not found the file. The file is there inside the WEB-INF/classess/com/company/sql/.
    Thanks
    Amit

  • Specifying a path to loada properties file

    I'm trying to load a properties file in java, the properties file is located in
    META-INF/sample.properties
    the class that loads the properties is in
    WEB-INF/classes/com/pkg1/pkg2/pkg3/pkg4/samplepgm.java
    how do I specify the path to load the properties file...

    you can only add images by using the place-function
    so you need to address the rectangle where the image is placed in.
    you can use use scriptlabels and then you can use something in the terms of
    document.Rectangles.Item("image").place(linktoyourfile)

  • Classpath root for locating properties file?

    I'm trying to read a property file from a pluggable Reports destination. I've tried placing it in the domain root and in the domain lib folder (I'm sure it was picked up there in a previous release) but I can't appear to find it.
    What is a general classpath root that could be used for storing properties files in?
    Thanks in advance,
    Nik

    Open your %DOMAIN_HOME%/server/AdminServer/logs/AdminServer.log and search for java.class.path.
    You'll see all classpath roots available, I'm using %DOMAIN_HOME%/config/soa-infra.
    Cheers,
    Vlad

  • Very weird issue with server logging when using log4j.properties file

    I'm using log4j logging. In log4j.properties the root logger is set up to use the ServerLoggingAppender class so that all our application logs go to the main server logfile. In addition, there are several appenders defined for specific components, with output going to specific per-component log files. Everything is going fine until I launch the server console. At this point all of those per-component log files get wiped out (zero length) and some non-ASCII lines are written to at least one of these files, after which the logs appear to be fine. The main server log file does not appear to be affected (because the root logger is set to "warn" level, while component-specific loggers are set to trace, the contents in these files is different; however I tried disabling all the other appenders and turning the root logger up to trace, and that still did not re-create the problem in the main server log file.
    And here's the really weird part -- if I use the same configuration, but in a log4j.xml file, the problem does not happen.

    Figured it out.
    We were passing in the configuration for log4j as -Dlog4j.configuration=file:/<properties file> and this was added to the command line for both the managed and admin servers. Problem is that the console app starts its own instance of log4j, and when it reads the configuration for the appenders it initializes or rolls over the files. At some point we have two JVMs accessing the same files, so some corruption is bound to happen.
    I'm not clear why the .xml file made a difference, but earlier we had been passing the log4j configuration as a jar file placed in the domain/lib folder, so perhaps the designer reverted to that (placed the log4j.xml file in a jar in lib, and not simply changed the -Dlog4j.configuration=file:/ option.

  • Need to Put Some data in Properties File and Access it

    HI Friends,
    I want to store the data (servername,User id ) in Archana.properties file from WebDYnpro Application
    Pls let e know where to place the properties file and also let me know how to access the properties file from WD application and Modify it.
    I have tried placing in: src/mimes, Configuration etc...but i am unale to access it.
    Also If i access the properties file and update it, do i again need to deploy the WD application.
    Kindly let me know if there are any better methods to store key value pairs from the application.
    Regards,
    Archana

    HI,
    The better approch will be to store the .properties file into a known folder manually created in the server  where the Application is deployed?
    That means where?
    Itried placing my .prpoerties file at several places in my Project(Not server)- Mimes, Configuration, Packages.
    I tried the same kind of  code u specifed.
    But the file.exists returns false, though there is a file in the location.
    When i am trying with javaproject, it works but in webdynpro project, its says file not found
    Below is the code:
    package com.sap.demo.casestudy.wd;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Properties;
    public class ReadWriteArc {
    @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              WriteProperty("Key3", "Value3");
              String value=ReaddProperty("key2");
         public static void WriteProperty(String key,String value) {
              try {
                        Properties pro = new Properties();
                        File f = new File("C:/Users/i067753/workspace/720/workspaceSetUp.jdi/LocalDevelopment/DCs/demo.sap.com/casestudy/_comp/src/configuration/Archana.Properties");
                        //File f = new File("C:/Users/i067753/workspace/720/workspaceSetUp.jdi/LocalDevelopment/DCs/demo.sap.com/casestudy/_comp/src/mimes/Components/com.sap.demo.casestudy.wd.comp.webdynproappln.WebDynproAppln/Archana.Properties");
                        //File f = new File("C:/Users/i067753/workspace/720/workspaceSetUp.jdi/LocalDevelopment/DCs/demo.sap.com/casestudy/_comp/src/packages/com/sap/demo/casestudy/wd/Archana.Properties");
                        if (!f.exists()) {
                             System.out.println("File not found!");
                        } else {
                             FileInputStream in = new FileInputStream(f);
                             pro.load(in);
                             pro.setProperty(key, value);
                             pro.store(new FileOutputStream("Properties"), null);
                             System.out.println("Operation completly successfuly!");
               catch (IOException e) {
                   System.out.println(e.getMessage());
         public static String ReaddProperty(String key) {
              try {
                   String valuemessage=null;
                        Properties pro = new Properties();
                        File f = new File("C:/Users/i067753/workspace/720/workspaceSetUp.jdi/LocalDevelopment/DCs/demo.sap.com/casestudy/_comp/src/configuration/Archana.Properties");
                        //File f = new File("C:/Users/i067753/workspace/720/workspaceSetUp.jdi/LocalDevelopment/DCs/demo.sap.com/casestudy/_comp/src/mimes/Components/com.sap.demo.casestudy.wd.comp.webdynproappln.WebDynproAppln/Archana.Properties");
                        //File f = new File("C:/Users/i067753/workspace/720/workspaceSetUp.jdi/LocalDevelopment/DCs/demo.sap.com/casestudy/_comp/src/packages/com/sap/demo/casestudy/wd/Archana.Properties");
                        if (!f.exists()) {
                             System.out.println("File not found!");
                        } else {
                             FileInputStream in = new FileInputStream(f);
                             pro.load(in);
                              valuemessage = pro.getProperty(key);
                             System.out.println("Read completly successfuly! and the value is "+valuemessage);
                        return valuemessage;
               catch (IOException e) {
                   System.out.println(e.getMessage());
               return null;
    And from WD Application i called the class as:
    ReadWriteArc.WriteProperty(engname, reserveEngine1);
    Pls suggest if am making any mistake here
    U say Server, how can i do that?
    Regards,
    Archana:)

  • Why jre makes unnecessary trips to server for getting properties file

    Hi,
    I'm using ResourceBundle.getBundle("myresource") method for loading the resourcebundle. I have placed my myresource.properties file in the jar which loaded, when UI getting loaded. But I could see from the java console(by entering 5), that java-plugin makes several trips to server, though I have the file in the client loaded jar file. How can I avoid it. Thanks for any help.
    The search goes as follows:
    Opening http://<servername>:7001/myresource.class
    Connecting http://<servername>:7001/myresource.class with no proxy
    Connecting http://<servername>:7001/myresource.class with cookie "JSESSIONID=APBnBCd2y8mJRQgGM9GqzXAT197iMQv7SaM9QORKg5mxvyp1PRKh!-1116598258"
    Opening http://<servername>:7001/myresource_en.class
    Connecting http://<servername>:7001/myresource_en.class with no proxy
    Connecting http://<servername>:7001/myresource_en.class with cookie "JSESSIONID=APBnBCd2y8mJRQgGM9GqzXAT197iMQv7SaM9QORKg5mxvyp1PRKh!-1116598258"
    Opening http://<servername>:7001/myresource_en.properties
    Connecting http://<servername>:7001/myresource_en.properties with no proxy
    Connecting http://<servername>:7001/myresource_en.properties with cookie "JSESSIONID=APBnBCd2y8mJRQgGM9GqzXAT197iMQv7SaM9QORKg5mxvyp1PRKh!-1116598258"
    Opening http://<servername>:7001/myresource_en_US.class
    Connecting http://<servername>:7001/myresource_en_US.class with no proxy
    Connecting http://<servername>:7001/myresource_en_US.class with cookie "JSESSIONID=APBnBCd2y8mJRQgGM9GqzXAT197iMQv7SaM9QORKg5mxvyp1PRKh!-1116598258"
    Thanks

    The reason the unnecessary trips are being made is that the ResourceBundle is using the default class loader to find the resource files. When a resource can't be found in the jar file, it will send a request to the server to see if it exists there. For the locale "en_US" and the bundle name "myresource", the ResourceBundle will attempt to load all of the following resources:
       myresource.class
       myresource.properties
       myresource_en.class
       myresource_en.properties
       myresource_en_US.class
       myresource_en_US.propertiesSince, you only had "myresource.properties" in your jar file, the ClassLoader attempted to find the other resources on the server.
    The following code can be used to create a resource bundle that uses a special classloader that only searches the included jar or zip files. This only works on 1.2 or greater JVMs.
       public ResourceBundle getResourceBundle(String bundleName) {
          ClassLoader rcl = null;
          Locale l = Locale.getDefault();
          ClassLoader cl = this.getClass().getClassLoader();
          if (cl instanceof java.net.URLClassLoader) {
             java.net.URLClassLoader ucl = (java.net.URLClassLoader)cl;
             URL[] urls = ucl.getURLs();
             ArrayList jarUrls = new ArrayList();
             for (int i=0; i<urls.length; i++) {
                String path = urls.getPath();
    if ((path.endsWith(".jar")) || (path.endsWith(".JAR")) ||
    (path.endsWith(".zip")) || (path.endsWith(".ZIP")))
    jarUrls.add(urls[i]);
    URL[] newUrls = new URL[jarUrls.size()];
    jarUrls.toArray(newUrls);
    rcl = java.net.URLClassLoader.newInstance(newUrls, null);
    } else {
    rcl = cl;
    DiagUtils.log("Resource bundle: " + bundleName + " initializing...");
    ResourceBundle rb = ResourceBundle.getBundle(bundleName, l, rcl);
    DiagUtils.log("Resource bundle: " + bundleName + " initialized.");
    return rb;
    The basic idea behind this code is to create a new URLClassLoader which only contains URLs that end with ".jar" or ".zip". The parent classloader must be set to null in the newInstance method.
    This will not work on the MSJVM because URLClassLoader was introduced with JDK 1.2.
    I hope this helps.
    -jonp

Maybe you are looking for

  • 8500A PLUS - Scan to Email - to another 8500A Plus email address will it print with no PC?

    Wanted to know if anyone has tried using two HP Officejet Pro  8500A Plus  SCAN to EMAIL feature without the use of a PC. Anything to look out for before spending the money on two of these units? Basically i want to set one up at my office the other

  • Error message when trying to scan to email or fax

    when I try to scan to email or fax i get this message: "secure connection to SMTP server could not be established..." I didn't have this problem when I first got the laserjet pro 200 m276. any thoughts on how to remedy>

  • Controlling amount of rows in a jtextfield with jscrollpane

    As part of a school assignment, I we have output going to a textfield that is scrolled with JScrollPane. Part of it is for when it comes to 400 lines, and another line is added, that the first line of the output is erased, and the new one is added. A

  • Possible to make an item editable for certain users and read only for other

    Is it possible to make an item editable for certain users and read only for others? I've been able to accomplish this by taken the select statement that I used to define an authorization scheme, placing it in the Read Only condition of the item. Howe

  • Problem with RTFEditorKit...............:(

    I'm quite confused with the following code snippet..........it doesn't turn up with any output(text) in the editor pane...........                 JFileChooser jfc=new JFileChooser();           int result=jfc.showOpenDialog(new JPanel());           i