3个回答
展开全部
setEnabled是设置是否可用
setEditable是设置是否可编辑
setEditable是设置是否可编辑
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
能说明一下是哪个包下面的吗?因为你说的情况好多包下面都有这些方法!
更多追问追答
追问
不晓得哪个包的,没找到,反正就是窗口中有个输入框的那个。。。。。我用了setEditable,写了false,输入框变成灰色不可输入,但我不晓得他们有啥子不一样
追答
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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解释,我英语不好,哈哈。你要是看懂了告诉俺一下,这里面好像是用户可以编辑,还有就是系统编辑,就是有些文本框,我们输入不进去,但是系统能输入进去。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询