By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,782 Members | 1,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,782 IT Pros & Developers. It's quick & easy.

AWTEvents errors and deprecated methods

P: n/a
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.getText().trim();
choice = Integer.parseInt(input);
String searchKey = otherInput.getText().trim();
int userSelection = facade.getUserSelection();
String[] resultSet = facade.
processUserSelection(userSelection,searchKey);
facade.displayResultSet(resultSet);

}

....//snipped

ERRORS/WARNINGS
..\java\awt\Frame.java:72: class$ is reserved for internal use
Class class$(String arg0)
^
..\java\awt\Font.java:240: package AttributedCharacterIterator does not exist
public AttributedCharacterIterator.Attribute[] getAvailableAttributes()
^
..\java\awt\AWTEvent.java:30: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
..\java\awt\AWTEvent.java:40: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
..\java\awt\AWTEvent.java:49: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.
5 errors

Tool completed with exit code 1

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Michael G" <mi****@montana.com> wrote in message
news:3f********@127.0.0.1...
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 ...//snipped

ERRORS/WARNINGS
.\java\awt\Frame.java:72: class$ is reserved for internal use
Class class$(String arg0)
^
.\java\awt\Font.java:240: package AttributedCharacterIterator does not exist public AttributedCharacterIterator.Attribute[] getAvailableAttributes()
^
.\java\awt\AWTEvent.java:30: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
.\java\awt\AWTEvent.java:40: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
.\java\awt\AWTEvent.java:49: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.
5 errors

Tool completed with exit code 1


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
Jul 17 '05 #2

P: n/a

"Michael G" <mi****@montana.com> wrote in message
news:3f********@127.0.0.1...
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


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

C:\CS595\VEHICL~1\VEHICLE>javac -deprecation ProcessingFacade.java
..\java\awt\Frame.java:72: class$ is reserved for internal use
Class class$(String arg0)
^
..\java\awt\Font.java:240: package AttributedCharacterIterator does not exist
public AttributedCharacterIterator.Attribute[] getAvailableAttributes()
^
..\java\awt\Component.java:1176: warning: postEvent(java.awt.Event) in
java.awt
enuContainer has been deprecated
public boolean postEvent(Event arg0)
^
..\java\awt\Frame.java:8: warning: postEvent(java.awt.Event) in
java.awt.MenuCo
ainer has been deprecated
public class Frame extends Window implements MenuContainer
^
..\java\awt\AWTEvent.java:30: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
..\java\awt\AWTEvent.java:40: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
..\java\awt\AWTEvent.java:49: cannot resolve symbol
symbol : constructor EventObject ()
location: class java.util.EventObject
{
^
5 errors
2 warnings
Jul 17 '05 #3

P: n/a

"Michael G" <mi****@montana.com> wrote in message
news:3f********@127.0.0.1...

"Michael G" <mi****@montana.com> wrote in message
news:3f********@127.0.0.1...


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
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.