在Java/Swing的全屏程序中停止使用Tab/Alt-F4 [英] Stopping the use of Tab/Alt-F4 in a full-screen program in Java/Swing

查看:231
本文介绍了在Java/Swing的全屏程序中停止使用Tab/Alt-F4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种在Java程序运行时阻止人们使用其他程序的方法.即停止人们切换标签并按Alt-F4.

I need a way to stop people using other programs while my Java program is running. i.e stopping people switch tabs and pressing Alt-F4.

推荐答案

使程序全屏使用;

 window.setExtendedState(Frame.MAXIMIZED_BOTH); //maximise window

 window.setUndecorated(true); //remove decorations e.g. x in top right

并使窗口始终处于最优先使用状态(以阻止人们使用其他正在运行的程序);

And to make the window always on top use(To stop people using other running programs);

window.setAlwaysOnTop(true);

这篇关于在Java/Swing的全屏程序中停止使用Tab/Alt-F4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆