AWTEvents errors and deprecated methods

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael G

    AWTEvents errors and deprecated methods

    I am getting some errors/warnings that I don't understand. This code is in
    a Java app that uses Swing J Components with an ActionListener. The
    code/errors/warnings follow. Thanks for any help, Mike

    import javax.swing.*;
    import java.awt.event. *;
    import java.awt.*;

    public class GraphicalImp extends UIImp implements ActionListener
    {


    ....//snipped code

    public void actionPerformed (ActionEvent e)
    {
    String input = userInput.getTe xt().trim();
    choice = Integer.parseIn t(input);
    String searchKey = otherInput.getT ext().trim();
    int userSelection = facade.getUserS election();
    String[] resultSet = facade.
    processUserSele ction(userSelec tion,searchKey) ;
    facade.displayR esultSet(result Set);

    }

    ....//snipped

    ERRORS/WARNINGS
    ..\java\awt\Fra me.java:72: class$ is reserved for internal use
    Class class$(String arg0)
    ^
    ..\java\awt\Fon t.java:240: package AttributedChara cterIterator does not exist
    public AttributedChara cterIterator.At tribute[] getAvailableAtt ributes()
    ^
    ..\java\awt\AWT Event.java:30: cannot resolve symbol
    symbol : constructor EventObject ()
    location: class java.util.Event Object
    {
    ^
    ..\java\awt\AWT Event.java:40: cannot resolve symbol
    symbol : constructor EventObject ()
    location: class java.util.Event Object
    {
    ^
    ..\java\awt\AWT Event.java:49: cannot resolve symbol
    symbol : constructor EventObject ()
    location: class java.util.Event Object
    {
    ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -deprecation for details.
    5 errors

    Tool completed with exit code 1



  • Michael G

    #2
    Re: AWTEvents errors and deprecated methods


    "Michael G" <mike-g@montana.com> wrote in message
    news:3fc974b3_4 @127.0.0.1...[color=blue]
    > I am getting some errors/warnings that I don't understand. This code is[/color]
    in[color=blue]
    > a Java app that uses Swing J Components with an ActionListener. The
    > code/errors/warnings follow. Thanks for any help, Mike[/color]
    [color=blue]
    > ...//snipped
    >
    > ERRORS/WARNINGS
    > .\java\awt\Fram e.java:72: class$ is reserved for internal use
    > Class class$(String arg0)
    > ^
    > .\java\awt\Font .java:240: package AttributedChara cterIterator does not[/color]
    exist[color=blue]
    > public AttributedChara cterIterator.At tribute[] getAvailableAtt ributes()
    > ^
    > .\java\awt\AWTE vent.java:30: cannot resolve symbol
    > symbol : constructor EventObject ()
    > location: class java.util.Event Object
    > {
    > ^
    > .\java\awt\AWTE vent.java:40: cannot resolve symbol
    > symbol : constructor EventObject ()
    > location: class java.util.Event Object
    > {
    > ^
    > .\java\awt\AWTE vent.java:49: cannot resolve symbol
    > symbol : constructor EventObject ()
    > location: class java.util.Event Object
    > {
    > ^
    > Note: Some input files use or override a deprecated API.
    > Note: Recompile with -deprecation for details.
    > 5 errors
    >
    > Tool completed with exit code 1
    >[/color]

    The problem with these errors is that it is in Sun's code not mine. I am
    using jdk1.4.1 and I have the associated docs. Makes no sense to me.

    Thanks, Mike


    Comment

    • Michael G

      #3
      Re: AWTEvents errors and deprecated methods


      "Michael G" <mike-g@montana.com> wrote in message
      news:3fc974b3_4 @127.0.0.1...[color=blue]
      > I am getting some errors/warnings that I don't understand. This code is[/color]
      in[color=blue]
      > a Java app that uses Swing J Components with an ActionListener. The
      > code/errors/warnings follow. Thanks for any help, Mike
      >[/color]

      I get the following when using "javac -deprecation ..."

      C:\CS595\VEHICL ~1\VEHICLE>java c -deprecation ProcessingFacad e.java
      ..\java\awt\Fra me.java:72: class$ is reserved for internal use
      Class class$(String arg0)
      ^
      ..\java\awt\Fon t.java:240: package AttributedChara cterIterator does not exist
      public AttributedChara cterIterator.At tribute[] getAvailableAtt ributes()
      ^
      ..\java\awt\Com ponent.java:117 6: warning: postEvent(java. awt.Event) in
      java.awt
      enuContainer has been deprecated
      public boolean postEvent(Event arg0)
      ^
      ..\java\awt\Fra me.java:8: warning: postEvent(java. awt.Event) in
      java.awt.MenuCo
      ainer has been deprecated
      public class Frame extends Window implements MenuContainer
      ^
      ..\java\awt\AWT Event.java:30: cannot resolve symbol
      symbol : constructor EventObject ()
      location: class java.util.Event Object
      {
      ^
      ..\java\awt\AWT Event.java:40: cannot resolve symbol
      symbol : constructor EventObject ()
      location: class java.util.Event Object
      {
      ^
      ..\java\awt\AWT Event.java:49: cannot resolve symbol
      symbol : constructor EventObject ()
      location: class java.util.Event Object
      {
      ^
      5 errors
      2 warnings


      Comment

      • Michael G

        #4
        Re: AWTEvents errors and deprecated methods


        "Michael G" <mike-g@montana.com> wrote in message
        news:3fc980ba_1 @127.0.0.1...[color=blue]
        >
        > "Michael G" <mike-g@montana.com> wrote in message
        > news:3fc974b3_4 @127.0.0.1...[/color]

        Finally figured it out. It was a compatibility error. I was using an IDE,
        I won't mention which one, and it was giving me a NullPointer exception if I
        ran it in the normal mode and it wouldn't throw the exception if I ran it in
        the debug mode. So I had the brilliant idea of using a command-line javac.
        The IDE placed the .class files in a jar, so I just let MY javac, not the
        IDE's, create .class files in the current dir. Anyway, once I did that the
        goofy errors started showing up. I don't totally understand why. To make a
        long story short - I spent almost all day yesterday trying to figure this
        thing out - I had too many versions of Java on my pc and I made the mistake
        of assuming that Java was consistent between versions. Shame on me.
        Jeff thanks for your help. Your insight got me on the right track.
        Mike


        Comment

        Working...