Skip to main content

Don't Understand a problem

8 replies [Last post]
KShap
Offline
Joined: 2006-02-17

Ok, whenever I compile my program this message pops up

Note: F:\Program Files\Xinox Software\JCreator Pro\MyProjects\TicTacToe\TicTacToe1.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.

What the hell does it mean?! Someone please help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vdkuil
Offline
Joined: 2006-02-17

It means you are using a method that is not preferred to be used anymore (ie there is a better alternative)

If you add the option -deprecation (or set deprecation=true the compile tag of your ant build file) you will see which method is deprecated...

Deprecation means it is still fully functional... but after a while it could get to obsolete. So it gives you time to change your code..

KShap
Offline
Joined: 2006-02-17

Ok, I did that but now it says this:

F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:222: warning: hide() in java.awt.Component has been deprecated
hide ();
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:239: warning: hide() in java.awt.Component has been deprecated
hide ();
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:335: warning: getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
FontMetrics myFontMetrics = Toolkit.getDefaultToolkit ().getFontMetrics (g.getFont ());
^
3 warnings

vdkuil
Offline
Joined: 2006-02-17

When you look at the method hide() of java.awt.Component you would see that this function is replaced with setVisible(boolean)....

So that would be the preferred function to use....

KShap
Offline
Joined: 2006-02-17

Sorry that I keep asking so many questions... now what?:

F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:222: setVisible(boolean) in java.awt.Component cannot be applied to (java.lang.Class)
setVisible(boolean.class);
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:239: setVisible(boolean) in java.awt.Component cannot be applied to (java.lang.Class)
setVisible(boolean.class);
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:335: warning: getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
FontMetrics myFontMetrics = Toolkit.getDefaultToolkit ().getFontMetrics (g.getFont ());
^
2 errors
1 warning

zander
Offline
Joined: 2003-06-13

You are in a class of over 300 lines, I suggest you look for similar situations before just trying combinations.
Your current guess is totally off.

KShap
Offline
Joined: 2006-02-17

What can i do now?

F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:222: '.class' expected
setVisible(boolean);
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:222: ')' expected
setVisible(boolean);
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:239: '.class' expected
setVisible(boolean); //hide ();
^
F:\Program Files\Xinox Software\JCreator Pro\MyProjects\Game Progs\TicTacToe\TicTacToe.java:239: ')' expected
setVisible(boolean); //hide ();
^

jaap
Offline
Joined: 2004-01-05

Google knows...

brinkley
Offline
Joined: 2003-06-06

Your topic was moved to the General Desktop Issues and Discussion as it is not a question about the JavaHelp API. The JavaHelp forum is a Q&A about the Java Help system, including Merging, Authoring, etc. Note: this area is not fot general help about Java. This forum is for discussion about the Help API. But you know that because you read the description just before you clicked on the JavaHelp forum.

binky