jQuery in Action, 2nd edition*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "show()" Watch "show()" New topic
Author

show()

Doit
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().


Regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Jim Yingst
Wanderer
Sheriff

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: http://aspose.com/file-tools
 
subject: show()
 
Similar Threads
start an Application
Unloading a frame
Components aren't seen in Frame/JFrame
Blank JFrame
how to switch between panel?