Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. Create an Interactive JavaFX Application (3 points):
  2. Create an application with the following controls:
  3. A Label control with the following text displayed: "First Number:"
  4. A Label control with the following text displayed: "Second Number:"
  5. An empty TextField control beside the First Number label.
  6. An empty TextField control beside the Second Number label.
  7. Five buttons:
  8. Button 1 labeled +
  9. Button 2 labeled -
  10. Button 3 labeled *
  11. Button 4 labeled /
  12. Button 5 labeled =
  13. An empty Label control that will display the result of a mathematical operation.
  14. Make sure there is spacing between each control.
  15. Align the controls:
  16. The Label control with the text First Number on the first line with a TextField beside it.
  17. The buttons labeled +, -, *, / on the second line. Make sure there is space between the buttons.
  18. The Label control with the text Second Number on the third line with a TextField beside it.
  19. The button labeled = on the fourth line.
  20. The label that will contain the result of the operation on the fifth line.
  21. Make sure the window is large enough to display all controls.
  22. Create an event for each button:
  23. Capture the text entered in the first TextField control. Note that values in a TextField are strings. You will need to convert it to a numeric value.
  24. Capture the text entered in the second TextField control. Note that values in a TextField are strings. You will need to convert it to a numeric value.
  25. Perform the mathematical operation indicated by the button being pressed.
  26. When the = button is pressed display the result of the calculation in the results label.
  27. The order of execution for the user is as follows. Your program must respond in this order:
  28. Enter a value in the first TextField.
  29. Click on an operation button.
  30. Enter a value in the second TextField.
  31. Click on the equals button.
  32. View the result in the Label control.
  33. Display the window.
  34. Submit your source code as a plain text file(s) with a .java extension.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement