Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: "The method show() from the type Window is deprecated"

this is a simple program to just open an AWT. Im using eclipse and i get the error shown above for frame.show(); Eclipse is crossing "show" with a line. All i want this program to do is just display a 300px by 300px frame window. Heres the full code:

    Frame frame = new Frame("Hello World");
    // ...        
    frame.show(); 
like image 729
Izzy Nakash Avatar asked Feb 19 '12 03:02

Izzy Nakash


1 Answers

The method show() is, indeed, deprecated. Deprecated means that you're not supposed to use it anymore, as it's been replaced by something better and may be removed in the future. In this case, you're supposed to use setVisible(true) instead.

If you go and look at the Javadoc for a deprecated method, it will generally tell you what the intended replacement is.

like image 113
Ernest Friedman-Hill Avatar answered Oct 16 '22 15:10

Ernest Friedman-Hill