java setenabled_JAVA中setEnabled和setEditable有什么不一样呢

//

setEditable

public void setEditable(boolean b)

Sets the flag that determines whether or not this text component is editable.

If the flag is set to true, this text component becomes user editable. If the flag is set to false, the user cannot change the text of this text component. By default, non-editable text components have a background color of SystemColor.control. This default can be overridden by calling setBackground.

Parameters:

b - a flag indicating whether this text component is user editable.

Since:

JDK1.0

See Also:

isEditable()

///

setEnabled

public void setEnabled(boolean b)

Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.

Note: Disabling a lightweight component does not prevent it from receiving MouseEvents.

Note: Disabling a heavyweight container prevents all components in this container from receiving any input events. But disabling a lightweight container affects only this container.

Parameters:

b - If true, this component is enabled; otherwise this component is disabled

Since:

JDK1.1

See Also:

isEnabled(), isLightweight()

以上是官方API解释,我英语不好,哈哈。你要是看懂了告诉俺一下,这里面好像是用户可以编辑,还有就是系统编辑,就是有些文本框,我们输入不进去,但是系统能输入进去。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值