日期计算器java(3)
发布时间:2021-06-07
发布时间:2021-06-07
86.
87. this.setLayout(new FlowLayout());
88. this.add(context);
89.
90. initWindow();
91.
92. this.setVisible(true);
93. }
94.
95. /**
96. * 初始化窗体
97. */
98. private void initWindow(){
99. context.setLayout(new BorderLayout(10,10)); 100.
101. // 显示面板
102. displayPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
103. displayPanel.add(result);
104. result.setHorizontalAlignment(JTextField.RIGHT);
105. result.setFocusable(false);
106. context.add(displayPanel,"North"); 107.
108. // 数字面板
109. numPanel.setLayout(new GridLayout(4,3,5,5));
110. for(int i=1;i<=9;i++){
111. numPanel.add(getNumberButton(i)); 112. }
113. numPanel.add(btnCE);
114. btnCE.addKeyListener(keyListener); 115. numPanel.add(getNumberButton(0)); 116.
117. btnCE.addActionListener(new ActionListener(){
118.
119. public void
actionPerformed(ActionEvent e) {
120. inputing = plus = minus = false;
121. result.setText("0");
122. result.setHorizontalAlignment(JTextField.RIGHT);
上一篇:企业基本情况表
下一篇:飞思卡尔智能车大赛终点标志的识别