tags:

views:

1150

answers:

4

Anyone know the reason (just curious)

+4  A: 

Most likely because they don't conform to the standard get/set naming scheme (they say, "As of JDK version 1.1, replaced by setVisible(boolean)").

Michael Myers
A: 

As of JDK version 1.1, replaced by Component.setVisible(boolean).

n00ki3
A: 

The hide and show methods of java.awt.Component have been deprecated for a while.

The proper way to set the visibility of a component is setVisible(boolean b)

Grasper
+4  A: 

JDK 1.1 introduced Java Beans. Java Beans rely in reflection and introspection to determine what the properties of a Bean are (a Bean is a "component"). Properties are then displayed in a Property Sheet.

By default beans use the following foormat:

boolean isXXX()
<type> getXXX()
void setXXX(<type>)

(going from memory on these next two... they are for indexed properties)

<type> getXXX(int)
void setXXX(<type>, int)

You can override the defaults, but rather than do that most things just rely on the naming pattern.

So show/hide didn't conform to the naming pattern and were replaced with setVisible(boolean) which did.

TofuBeer
Well, that is true, but what prevents a bean from having a method with pretty darn good name?
I thought may be because show and hide methods don't send PropertyChangeEvents -- but setVisible doesn't do that either ....