简易计算器不需要很高深的算法,对于数字计算的唯一要求就是在除数为零的时候要加以判断和处理,其他的就是窗口布局和功能完善了;首先:计算器需要一个显示按键结果的Te...
代码说明:
简易计算器不需要很高深的算法,对于数字计算的唯一要求就是在除数为零的时候要加以判断和处理,其他的就是窗口布局和功能完善了;首先:计算器需要一个显示按键结果的TextField部件,再就是添加很多Button了;为了界面的美观,为Frame添加两个panel,一个布局用BorderLayout.NORTH,另一个用GridLayout分成均等的几行几列;窗口的整体布局就基本成形了。剩下的为Button添加事件及响应事件的结果,编写程序实现。-simple calculators do not need high deep algorithm, figures for the only requirement is the divisor to zero when the judgment and, The rest is window layout and functions; First : need a calculator button shows the results of the TextField component, Then, it took a lot of added Button; To the beautiful interface, Frame added two panel, BorderLayout.NORTH using a layout, Another use GridLayout divided into equal out several lines; window on the overall layout of the basic shaping. Button left to add events and respond to the findings, preparation processes.
下载说明:请别用迅雷下载,失败请重下,重下不扣分!