JButton最小化窗口(JFrame) [英] JButton minimizing a window(JFrame)
问题描述
我正在尝试为我的应用程序创建自己的框架.我已经通过使用 setUndecorated(true)
删除了标准框架.我有一个工作的退出按钮(不是那么困难),但是我想拥有一个JButton,它等于右上角的windows-minimizing-button.我尝试了几种解决方案,例如 hide()
, HIDE_ON_CLOSE
甚至是 setVisible()
.但是他们都不给我想要的结果.
Im trying to create my own Frame for my application.
I have removed the standard Frame by using setUndecorated(true)
. I have a working exit button (not that difficult), but i want to have a JButton equal to the windows-minimizing-button in the top-right corner.
I have tried several solutions as hide()
, HIDE_ON_CLOSE
and even setVisible()
. But non of them is giving me the wanted result.
我将JFrame扩展到我的班级.
Im extending a JFrame to my class.
我在想一些Mouselistener(?),但是我现在就像一个大问号.
I am thinking of some Mouselistener(?), but im like a big question mark right now.
推荐答案
http://www.google.com/search?q=jframe+最小化
第一个链接:
http://java-puzzle.blogspot.com/2009/07/tutorial-to-minimize-jframe-dynamically.html
frame.setExtendedState(JFrame.ICONIFIED);
这篇关于JButton最小化窗口(JFrame)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!