Advertisement
Guest User

Calculadora

a guest
Nov 22nd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.42 KB | None | 0 0
  1. package calculadora;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /*
  6. * @author Alcântara
  7. */
  8. public class CalculadoraJFrame extends javax.swing.JFrame {
  9.  
  10. double a3;
  11. float addition,
  12. subtraction,
  13. multiplication,
  14. division,
  15. square,
  16. math,
  17. pot,
  18. a1,
  19. a2;
  20. int count,
  21. one = 0;
  22. Scanner ler = new Scanner(System.in);
  23.  
  24.  
  25. public CalculadoraJFrame() {
  26. initComponents();
  27. }
  28.  
  29.  
  30. @SuppressWarnings("unchecked")
  31. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  32. private void initComponents() {
  33.  
  34. jPanelCalculadora = new javax.swing.JPanel();
  35. B0 = new javax.swing.JButton();
  36. Result = new javax.swing.JTextField();
  37. B1 = new javax.swing.JButton();
  38. B2 = new javax.swing.JButton();
  39. B3 = new javax.swing.JButton();
  40. B4 = new javax.swing.JButton();
  41. B5 = new javax.swing.JButton();
  42. B6 = new javax.swing.JButton();
  43. B7 = new javax.swing.JButton();
  44. B8 = new javax.swing.JButton();
  45. B9 = new javax.swing.JButton();
  46. Point = new javax.swing.JButton();
  47. Plus = new javax.swing.JButton();
  48. Minus = new javax.swing.JButton();
  49. Divide = new javax.swing.JButton();
  50. Multiply = new javax.swing.JButton();
  51. Clean = new javax.swing.JButton();
  52. Equal = new javax.swing.JButton();
  53. Square = new javax.swing.JButton();
  54. Pot = new javax.swing.JButton();
  55.  
  56. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  57. setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
  58. setMaximumSize(new java.awt.Dimension(180, 289));
  59. setMinimumSize(new java.awt.Dimension(180, 289));
  60. setPreferredSize(new java.awt.Dimension(180, 289));
  61.  
  62. jPanelCalculadora.setMaximumSize(new java.awt.Dimension(286, 289));
  63. jPanelCalculadora.setMinimumSize(new java.awt.Dimension(286, 289));
  64.  
  65. B0.setText("0");
  66. B0.addActionListener(new java.awt.event.ActionListener() {
  67. public void actionPerformed(java.awt.event.ActionEvent evt) {
  68. B0ActionPerformed(evt);
  69. }
  70. });
  71.  
  72. Result.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
  73. Result.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
  74. Result.addActionListener(new java.awt.event.ActionListener() {
  75. public void actionPerformed(java.awt.event.ActionEvent evt) {
  76. ResultActionPerformed(evt);
  77. }
  78. });
  79.  
  80. B1.setText("1");
  81. B1.addActionListener(new java.awt.event.ActionListener() {
  82. public void actionPerformed(java.awt.event.ActionEvent evt) {
  83. B1ActionPerformed(evt);
  84. }
  85. });
  86.  
  87. B2.setText("2");
  88. B2.addActionListener(new java.awt.event.ActionListener() {
  89. public void actionPerformed(java.awt.event.ActionEvent evt) {
  90. B2ActionPerformed(evt);
  91. }
  92. });
  93.  
  94. B3.setText("3");
  95. B3.addActionListener(new java.awt.event.ActionListener() {
  96. public void actionPerformed(java.awt.event.ActionEvent evt) {
  97. B3ActionPerformed(evt);
  98. }
  99. });
  100.  
  101. B4.setText("4");
  102. B4.addActionListener(new java.awt.event.ActionListener() {
  103. public void actionPerformed(java.awt.event.ActionEvent evt) {
  104. B4ActionPerformed(evt);
  105. }
  106. });
  107.  
  108. B5.setText("5");
  109. B5.addActionListener(new java.awt.event.ActionListener() {
  110. public void actionPerformed(java.awt.event.ActionEvent evt) {
  111. B5ActionPerformed(evt);
  112. }
  113. });
  114.  
  115. B6.setText("6");
  116. B6.addActionListener(new java.awt.event.ActionListener() {
  117. public void actionPerformed(java.awt.event.ActionEvent evt) {
  118. B6ActionPerformed(evt);
  119. }
  120. });
  121.  
  122. B7.setText("7");
  123. B7.addActionListener(new java.awt.event.ActionListener() {
  124. public void actionPerformed(java.awt.event.ActionEvent evt) {
  125. B7ActionPerformed(evt);
  126. }
  127. });
  128.  
  129. B8.setText("8");
  130. B8.addActionListener(new java.awt.event.ActionListener() {
  131. public void actionPerformed(java.awt.event.ActionEvent evt) {
  132. B8ActionPerformed(evt);
  133. }
  134. });
  135.  
  136. B9.setText("9");
  137. B9.addActionListener(new java.awt.event.ActionListener() {
  138. public void actionPerformed(java.awt.event.ActionEvent evt) {
  139. B9ActionPerformed(evt);
  140. }
  141. });
  142.  
  143. Point.setText(".");
  144. Point.addActionListener(new java.awt.event.ActionListener() {
  145. public void actionPerformed(java.awt.event.ActionEvent evt) {
  146. PointActionPerformed(evt);
  147. }
  148. });
  149.  
  150. Plus.setText("+");
  151. Plus.setPreferredSize(new java.awt.Dimension(30, 15));
  152. Plus.addActionListener(new java.awt.event.ActionListener() {
  153. public void actionPerformed(java.awt.event.ActionEvent evt) {
  154. PlusActionPerformed(evt);
  155. }
  156. });
  157.  
  158. Minus.setText("-");
  159. Minus.setPreferredSize(new java.awt.Dimension(30, 15));
  160. Minus.addActionListener(new java.awt.event.ActionListener() {
  161. public void actionPerformed(java.awt.event.ActionEvent evt) {
  162. MinusActionPerformed(evt);
  163. }
  164. });
  165.  
  166. Divide.setText("÷");
  167. Divide.setPreferredSize(new java.awt.Dimension(30, 15));
  168. Divide.addActionListener(new java.awt.event.ActionListener() {
  169. public void actionPerformed(java.awt.event.ActionEvent evt) {
  170. DivideActionPerformed(evt);
  171. }
  172. });
  173.  
  174. Multiply.setText("*");
  175. Multiply.setPreferredSize(new java.awt.Dimension(30, 15));
  176. Multiply.addActionListener(new java.awt.event.ActionListener() {
  177. public void actionPerformed(java.awt.event.ActionEvent evt) {
  178. MultiplyActionPerformed(evt);
  179. }
  180. });
  181.  
  182. Clean.setBackground(new java.awt.Color(255, 255, 255));
  183. Clean.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
  184. Clean.setForeground(new java.awt.Color(0, 153, 51));
  185. Clean.setText("C");
  186. Clean.addActionListener(new java.awt.event.ActionListener() {
  187. public void actionPerformed(java.awt.event.ActionEvent evt) {
  188. CleanActionPerformed(evt);
  189. }
  190. });
  191.  
  192. Equal.setText("=");
  193. Equal.addActionListener(new java.awt.event.ActionListener() {
  194. public void actionPerformed(java.awt.event.ActionEvent evt) {
  195. EqualActionPerformed(evt);
  196. }
  197. });
  198.  
  199. Square.setText("√");
  200. Square.addActionListener(new java.awt.event.ActionListener() {
  201. public void actionPerformed(java.awt.event.ActionEvent evt) {
  202. SquareActionPerformed(evt);
  203. }
  204. });
  205.  
  206. Pot.setText("x²");
  207. Pot.addActionListener(new java.awt.event.ActionListener() {
  208. public void actionPerformed(java.awt.event.ActionEvent evt) {
  209. PotActionPerformed(evt);
  210. }
  211. });
  212.  
  213. javax.swing.GroupLayout jPanelCalculadoraLayout = new javax.swing.GroupLayout(jPanelCalculadora);
  214. jPanelCalculadora.setLayout(jPanelCalculadoraLayout);
  215. jPanelCalculadoraLayout.setHorizontalGroup(
  216. jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  217. .addGroup(jPanelCalculadoraLayout.createSequentialGroup()
  218. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  219. .addGroup(jPanelCalculadoraLayout.createSequentialGroup()
  220. .addGap(12, 12, 12)
  221. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  222. .addComponent(Plus, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
  223. .addComponent(Minus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  224. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  225. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  226. .addComponent(Divide, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
  227. .addComponent(Multiply, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  228. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  229. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  230. .addGroup(jPanelCalculadoraLayout.createSequentialGroup()
  231. .addComponent(Pot, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
  232. .addGap(0, 0, Short.MAX_VALUE))
  233. .addComponent(Square, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
  234. .addGroup(jPanelCalculadoraLayout.createSequentialGroup()
  235. .addGap(12, 12, 12)
  236. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  237. .addComponent(B1, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE)
  238. .addComponent(B4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  239. .addComponent(B0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  240. .addComponent(B7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  241. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  242. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  243. .addComponent(B8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  244. .addComponent(B5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  245. .addComponent(B2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  246. .addComponent(Point, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
  247. .addGap(18, 18, 18)
  248. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  249. .addComponent(B6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  250. .addComponent(B9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  251. .addComponent(B3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  252. .addComponent(Clean, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
  253. .addGroup(jPanelCalculadoraLayout.createSequentialGroup()
  254. .addContainerGap()
  255. .addComponent(Result))
  256. .addGroup(jPanelCalculadoraLayout.createSequentialGroup()
  257. .addContainerGap()
  258. .addComponent(Equal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
  259. .addGap(112, 112, 112))
  260. );
  261. jPanelCalculadoraLayout.setVerticalGroup(
  262. jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  263. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCalculadoraLayout.createSequentialGroup()
  264. .addContainerGap()
  265. .addComponent(Result, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
  266. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  267. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  268. .addComponent(Plus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  269. .addComponent(Multiply, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  270. .addComponent(Square, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  271. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  272. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  273. .addComponent(Minus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  274. .addComponent(Divide, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  275. .addComponent(Pot))
  276. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  277. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  278. .addComponent(B7)
  279. .addComponent(B8)
  280. .addComponent(B9))
  281. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  282. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  283. .addComponent(B4)
  284. .addComponent(B5)
  285. .addComponent(B6))
  286. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  287. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  288. .addComponent(B1)
  289. .addComponent(B2)
  290. .addComponent(B3))
  291. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  292. .addGroup(jPanelCalculadoraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  293. .addComponent(B0)
  294. .addComponent(Point)
  295. .addComponent(Clean))
  296. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  297. .addComponent(Equal)
  298. .addGap(18, 18, 18))
  299. );
  300.  
  301. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  302. getContentPane().setLayout(layout);
  303. layout.setHorizontalGroup(
  304. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  305. .addGroup(layout.createSequentialGroup()
  306. .addContainerGap()
  307. .addComponent(jPanelCalculadora, javax.swing.GroupLayout.PREFERRED_SIZE, 244, Short.MAX_VALUE)
  308. .addContainerGap())
  309. );
  310. layout.setVerticalGroup(
  311. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  312. .addComponent(jPanelCalculadora, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  313. );
  314.  
  315. pack();
  316. }// </editor-fold>
  317.  
  318. private void EqualActionPerformed(java.awt.event.ActionEvent evt) {
  319. // TODO add your handling code here:
  320.  
  321. switch (count) {
  322.  
  323. case 1: {
  324. a2 = Float.valueOf(Result.getText());
  325. addition = a1 + a2;
  326. Result.setText(String.valueOf(addition));
  327. count = 0;
  328. break;
  329. }
  330.  
  331. case 2: {
  332. a2 = Float.valueOf(Result.getText());
  333. multiplication = a2 * a1;
  334. Result.setText(String.valueOf(multiplication));
  335. count = 0;
  336. break;
  337. }
  338.  
  339. case 3: {
  340. a2 = Float.valueOf(Result.getText());
  341. division = a1 / a2;
  342. Result.setText(String.valueOf(division));
  343. count = 0;
  344. break;
  345. }
  346.  
  347. case 4: {
  348. a2 = Float.valueOf(Result.getText());
  349. subtraction = a1 - a2;
  350. Result.setText(String.valueOf(subtraction));
  351. count = 0;
  352. break;
  353. }
  354. }
  355. }
  356.  
  357. private void CleanActionPerformed(java.awt.event.ActionEvent evt) {
  358. // TODO add your handling code here:
  359. Result.setText ("");
  360. }
  361.  
  362. private void MultiplyActionPerformed(java.awt.event.ActionEvent evt) {
  363. // TODO add your handling code here:
  364. a1 = Float.valueOf(Result.getText());
  365. Result.setText("");
  366.  
  367. count = one + 2;
  368. }
  369.  
  370. private void PlusActionPerformed(java.awt.event.ActionEvent evt) {
  371. // TODO add your handling code here:
  372. a1 = Float.valueOf(Result.getText());
  373. Result.setText("");
  374.  
  375. count = one + 1;
  376. }
  377.  
  378. private void B9ActionPerformed(java.awt.event.ActionEvent evt) {
  379. // TODO add your handling code here:
  380. Result.setText(Result.getText() + "9");
  381. }
  382.  
  383. private void B8ActionPerformed(java.awt.event.ActionEvent evt) {
  384. // TODO add your handling code here:
  385. Result.setText (Result.getText() + "8");
  386. }
  387.  
  388. private void B7ActionPerformed(java.awt.event.ActionEvent evt) {
  389. // TODO add your handling code here:
  390. Result.setText (Result.getText() + "7");
  391. }
  392.  
  393. private void B6ActionPerformed(java.awt.event.ActionEvent evt) {
  394. // TODO add your handling code here:
  395. Result.setText (Result.getText() + "6");
  396. }
  397.  
  398. private void B5ActionPerformed(java.awt.event.ActionEvent evt) {
  399. // TODO add your handling code here:
  400. Result.setText (Result.getText() + "5");
  401. }
  402.  
  403. private void B4ActionPerformed(java.awt.event.ActionEvent evt) {
  404. // TODO add your handling code here:
  405. Result.setText (Result.getText() + "4");
  406. }
  407.  
  408. private void B3ActionPerformed(java.awt.event.ActionEvent evt) {
  409. // TODO add your handling code here:
  410. Result.setText (Result.getText() + "3");
  411. }
  412.  
  413. private void B2ActionPerformed(java.awt.event.ActionEvent evt) {
  414. // TODO add your handling code here:
  415. Result.setText (Result.getText() + "2");
  416. }
  417.  
  418. private void B1ActionPerformed(java.awt.event.ActionEvent evt) {
  419. // TODO add your handling code here:
  420. Result.setText (Result.getText() + "1");
  421. }
  422.  
  423. private void ResultActionPerformed(java.awt.event.ActionEvent evt) {
  424. // TODO add your handling code here:
  425. Result.insets();
  426. }
  427.  
  428. private void DivideActionPerformed(java.awt.event.ActionEvent evt) {
  429. // TODO add your handling code here:
  430. a1 = Float.valueOf(Result.getText());
  431. Result.setText("");
  432.  
  433. count = one + 3;
  434. }
  435.  
  436. private void MinusActionPerformed(java.awt.event.ActionEvent evt) {
  437. // TODO add your handling code here:
  438. a1 = Float.valueOf(Result.getText());
  439. Result.setText("");
  440.  
  441. count = one + 4;
  442. }
  443.  
  444. private void PointActionPerformed(java.awt.event.ActionEvent evt) {
  445. // TODO add your handling code here:
  446. Result.setText(Result.getText() + ".");
  447. }
  448.  
  449. private void B0ActionPerformed(java.awt.event.ActionEvent evt) {
  450. // TODO add your handling code here:
  451. Result.setText(Result.getText() + "0");
  452. }
  453.  
  454. private void SquareActionPerformed(java.awt.event.ActionEvent evt) {
  455. // TODO add your handling code here:
  456. a3 = Float.valueOf(Result.getText());
  457. square = (float) Math.sqrt(a3);
  458. Result.setText(String.valueOf(square));
  459.  
  460. }
  461.  
  462. private void PotActionPerformed(java.awt.event.ActionEvent evt) {
  463. // TODO add your handling code here:
  464. a3 = Float.valueOf(Result.getText());
  465. pot = (float) Math.pow(a3, 2);
  466. Result.setText(String.valueOf(pot));
  467.  
  468. }
  469.  
  470.  
  471.  
  472. /**
  473. * @param args the command line arguments
  474. */
  475. public static void main(String args[]) {
  476. /* Set the Nimbus look and feel */
  477. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  478. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  479. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  480. */
  481. try {
  482. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  483. if ("Nimbus".equals(info.getName())) {
  484. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  485. break;
  486. }
  487. }
  488. } catch (ClassNotFoundException ex) {
  489. java.util.logging.Logger.getLogger(CalculadoraJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  490. } catch (InstantiationException ex) {
  491. java.util.logging.Logger.getLogger(CalculadoraJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  492. } catch (IllegalAccessException ex) {
  493. java.util.logging.Logger.getLogger(CalculadoraJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  494. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  495. java.util.logging.Logger.getLogger(CalculadoraJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  496. }
  497. //</editor-fold>
  498.  
  499. /* Create and display the form */
  500. java.awt.EventQueue.invokeLater(new Runnable() {
  501. public void run() {
  502. new CalculadoraJFrame().setVisible(true);
  503. }
  504. });
  505. }
  506. // Variables declaration - do not modify
  507. private javax.swing.JButton B0;
  508. private javax.swing.JButton B1;
  509. private javax.swing.JButton B2;
  510. private javax.swing.JButton B3;
  511. private javax.swing.JButton B4;
  512. private javax.swing.JButton B5;
  513. private javax.swing.JButton B6;
  514. private javax.swing.JButton B7;
  515. private javax.swing.JButton B8;
  516. private javax.swing.JButton B9;
  517. private javax.swing.JButton Clean;
  518. private javax.swing.JButton Divide;
  519. private javax.swing.JButton Equal;
  520. private javax.swing.JButton Minus;
  521. private javax.swing.JButton Multiply;
  522. private javax.swing.JButton Plus;
  523. private javax.swing.JButton Point;
  524. private javax.swing.JButton Pot;
  525. private javax.swing.JTextField Result;
  526. private javax.swing.JButton Square;
  527. private javax.swing.JPanel jPanelCalculadora;
  528. // End of variables declaration
  529.  
  530. private float pow(float a1, float a21) {
  531. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  532. }
  533.  
  534. private float pow(float a1, int i) {
  535. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  536. }
  537.  
  538. private float sqrt(float a1) {
  539. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  540. }
  541. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement