java中setEditable(false)是什么意思

2024-12-15 18:45:09
推荐回答(5个)
回答1:

setselected(false)是设置选项不可用。
通常在实际的应用中,如选择了性别为男,那么关于一些女性的设置选项就不需要填写了,此时为了防止误操作,那么久就把下拉选框设置为”灰色“(禁用)。
备注:如果想启用的话,直接setselected(true)即可。

回答2:

使调用这个函数的控件不能被编辑,如果设为true或者不调用这个函数,则控件可以编辑

回答3:

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解释,我英语不好,哈哈。你要是看懂了告诉俺一下,这里面好像是用户可以编辑,还有就是系统编辑,就是有些文本框,我们输入不进去,但是系统能输入进去。

回答4:

你没发现你答非所问吗

回答5:

使那个编辑框不能编辑吧~也就不能修改。