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();
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With