我正在Windows XP上使用Java开发一个KIOSK系统,需要制作屏幕键盘。但是我不知道如何实现它。请问有没有人了解这方面的知识并能够给我提供帮助。谢谢!
这个问题出现在搜索如何在Java / Swing中进入锁定的亭子模式时... - 我花了一段时间才找到如何做到这一点,所以在这里为任何像我一样最终到达这里的人提供:
public class FullScreen extends JWindow {
public FullScreen()
{
getContentPane().add(new JLabel("A JFrame Kiosk"), BorderLayout.NORTH);
JButton closeButton = new JButton("Close");
closeButton.addActionListener( new ActionListener()
{
public void actionPerformed( ActionEvent ae )
{
System.out.println("Close button Pressed");
FullScreen.this.setVisible(false);
System.exit(0);
}
});
getContentPane().add(closeButton, BorderLayout.CENTER);
}
public static void main(String[] args) throws Exception {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
GraphicsEnvironment.
getLocalGraphicsEnvironment().
getDefaultScreenDevice().
setFullScreenWindow(new FullScreen());
}
});
}
}