我需要填充JPassword
字段。但是看起来没有方法setPassword (char [])
唯一的方法是setText
. 但是我需要喂一个String
由于getText
已弃用,所以我认为setText
也将被弃用。
When calling getText you get a String (immutable object) that may not be changed (except reflection) and so the password stays in the memory until garbage collected
当我setText
. 我喂一个String
,它留在记忆中。为什么不setText
被弃用?为什么没有setPassword (char [])
方法?