1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

saving, opening afile

Discussion in 'Software Development' started by Caliraj, Feb 15, 2007.

Thread Status:
Not open for further replies.
  1. Caliraj

    Caliraj Thread Starter

    Joined:
    Mar 22, 2006
    Messages:
    145
    Hi,
    Here is a sample program that I came across related to the File Dialog aspect. Im unable to solve the error.

    import java.awt.*;
    import java.applet.*;
    public class filedial extends Applet
    {
    public static void main(String args[])
    {
    frams fr=new frams("My first window");
    fr.setSize(400,300);
    fr.setVisible(true);
    FileDialog fd=new FileDialog(fr,"Open",FileDialog.LOAD);
    fd.show();
    }
    }
    class frams extends Frame
    {
    public frams(String s1)
    {
    super(s1);
    }
    }

    I get the following error:
    Note: filedial.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
     
  2. Chicon

    Chicon

    Joined:
    Jul 29, 2004
    Messages:
    6,650
    Hi Caliraj,

    The show() method of the FileDialog component is not supported any more.
    Therefore, you've just to replace the line
    fd.show();
    by
    fd.setVisible(true);
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/544229

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice