File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes show() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "show()" Watch "show()" New topic


Ranch Hand

Joined: Aug 03, 2000
Posts: 169
show() or setVisisble() may be used for displaying the frame.
For displaying Frame, we need setSize and setVisible methods. can
the setVisible be replaced by show() method??
- Thanks
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

While I am not sure if its a good practice or not,
but yes, it works. The documentation on the API
doesnot say much.....To me it looks like this should
be used in conjunction with hide().

- satya

Take a Minute, Donate an Hour, Change a Life
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
show() and hide() are deprecated since 1.1. Yes, you can still use them, but it's preferred that you use setVisible() instead. I think that the only reason for this is that Sun wanted method names to be more standardized. setXXX() and getXXX() are the standard names for methods which access a field XXX. This is important particularly if you are making a JavaBean out of the class, which is what Sun was doing when they made the change I think.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: show()
jQuery in Action, 3rd edition