很菜的问题(Swing)

hfwsw 2004-06-29 10:07:43
我写了一个socket程序,当服务器端收到信息后弹出一个JFrame窗口,如何才能让这个窗口置于最顶端?
如何让它active,得到focus
...全文
74 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hfwsw 2004-06-29
  • 打赏
  • 举报
回复
诶,真是的,怪自己粗心,没看清楚,谢谢!
OptimismNo1 2004-06-29
  • 打赏
  • 举报
回复
Up
eclipse0016 2004-06-29
  • 打赏
  • 举报
回复
Window类的方法:

toFront()
If this Window is visible, brings this Window to the front and may make it the focused Window.
Jkate 2004-06-29
  • 打赏
  • 举报
回复
JFrame frame=new Frame();
frame.toFront();
就OK了
mephistoxp 2004-06-29
  • 打赏
  • 举报
回复
估计需要windows平台的知识。
帮你顶一下。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧