Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是Java的初学者。我正在尝试创建一个小型 GUI,它将调整给定图像的大小并左对齐,右对齐。您能否解释一下或将我重定向到有关 setfocuspainted 方法的文章文档?
该setFocusPainted方法可用于设置组件周围是否有蓝色对焦环。例如:randomButton.setFocusPainted(true);会给randomButton一个对焦环,并randomButton.setFocusPainted(false);会移除对焦环。
setFocusPainted
randomButton.setFocusPainted(true);
randomButton
randomButton.setFocusPainted(false);