Java Component.show()/ hide()已弃用...为什么? [英] Java Component.show() / hide() are deprecated ... why?

查看:209
本文介绍了Java Component.show()/ hide()已弃用...为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道原因(只是好奇)

Anyone know the reason (just curious)

推荐答案

JDK 1.1引入了Java Beans。 Java Bean依靠反射和内省来确定Bean的属性(Bean是组件)。然后,属性显示在属性表中。

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.

默认bean使用以下foormat:

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.

因此show / hide不符合命名模式并被setVisible替换( boolean)做了。

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

这篇关于Java Component.show()/ hide()已弃用...为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆