简体   繁体   English

JButton最小化窗口(JFrame)

[英]JButton minimizing a window(JFrame)

Im trying to create my own Frame for my application. 我正在尝试为我的应用程序创建自己的框架。 I have removed the standard Frame by using setUndecorated(true) . 我已经使用setUndecorated(true)删除了标准Frame。 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. 我有一个工作的退出按钮(不是那么困难),但是我想拥有一个JButton,它等于右上角的windows-minimizing-button。 I have tried several solutions as hide() , HIDE_ON_CLOSE and even setVisible() . 我尝试了几种解决方案,例如hide()HIDE_ON_CLOSE甚至setVisible() But non of them is giving me the wanted result. 但是他们都不给我想要的结果。

Im extending a JFrame to my class. 我将JFrame扩展到我的班级。

I am thinking of some Mouselistener(?), but im like a big question mark right now. 我在想一些Mouselistener(?),但是我现在就像一个大问号。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM