计算器应用程序包括java swing中的键盘输入 [英] Calculator application including keyboard input in java swing

查看:117
本文介绍了计算器应用程序包括java swing中的键盘输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在java swing中有一个计算器应用程序,它可以通过鼠标点击输入正常工作。现在我希望它使用键盘按钮笔划读取输入。我在java教程中听说过玻璃窗格,但我需要知道任何其他简单的方法来满足要求。

I have a calculator application in java swing, which is working properly with mouse click input. Now I want it to read input using keyboard button stroke. I had heard about the glass pane in java tutorial, but i need to know any other simple method to meet the requirement.

推荐答案

KeyPadPanel 是使用 Action <的示例/ code> 键绑定 用于输入数字。

KeyPadPanel is an example that uses Action and Key Bindings for numeric entry.

这篇关于计算器应用程序包括java swing中的键盘输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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