JavaFX Scene Builder Tutorial 34 - Calculator JavaFX
Code Amir
View ChannelAbout
Code Amir channel is a channel specialized in programming and development using many languages, such as Java, Python, Php, SQL, Ruby, HTML , JavaScript, C Language, C++, C#, Objective-C, Swift And Framwork such as AngularJS, Angular, Django, Vue.js, Node.js, React.js, Polymer, Php Symfony, Flask, laravel Create and develop many professional Project using allProgramming Languages. Troubleshoot operating system problems such as Windows and Linux.
Latest Posts
Video Description
JavaFX Scene Builder Tutorial 34 Calculator JavaFX Code source here : https://codebyamir.blogspot.com/ @FXML private TextField txt_result; String op =""; long number1; long number2; // First Method public void Number (ActionEvent ae){ String no = ((Button)ae.getSource()).getText(); txt_result.setText(txt_result.getText()+no); } // Second Method public void Operation (ActionEvent ae){ String operation = ((Button)ae.getSource()).getText(); if (!operation.equals("=")){ if(!op.equals("")){ return; } op = operation; number1 = Long.parseLong(txt_result.getText()); txt_result.setText(""); }else { if(op.equals("")){ return; } number2 = Long.parseLong(txt_result.getText()); calculate(number1, number2, op); op=""; } } // 3 Methode public void calculate (long n1, long n2, String op){ switch (op){ case "+" : txt_result.setText(n1 + n2 + "");break; case "-" : txt_result.setText(n1 - n2 + "");break; case "*" : txt_result.setText(n1 * n2 + "");break; case "/" : if (n2 == 0){ txt_result.setText("0");break; } txt_result.setText(n1/n2+ "");break; } } Libraries Importing : import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.TextField;
DIY Slime Essentials: Make Now!
AI-recommended products based on this video

Gorilla Super Glue Gel, Fast-Setting, Thick Formula with Anti-Clog Cap, Clear Cyanoacrylate, 0.53oz/15g, Pack of 1

3D Spiral Apples Silicone Molds for Baking | Food Grade Mousse Cake Chocolate Molds | Reusable Baking Molds Silicone Shapes (3.46x3.46x2.09in)

Apples Silicone molds Spiral Pastry Chocolate Mousse Cake Molds for Cupcake topper, Candy, Gummy, Ice Cube, Soap

Spiral Apples Mousse Cake Silicone molds French Pastry Chocolate molds Candle molds Burns Up to 45 Hours - Pack of 6, Frost

Spiral Apples Mousse Cake Silicone molds French Pastry Chocolate molds Candle molds Burns Up to 45 Hours - Pack of 6, Frost

Windshield Repair kit, DIY Glass Cracked Repair Kits, Easy to Use Automotive Glass Nano Repair Fluid, Scratch Chip Cracks Repair Kit (2 Pack) (Black)

Windshield Crack Repair kit Windshield Repair kit, Glass Repair kit, DIY Glass Cracked Repair Kits, Easy to Use Automotive Glass Nano Repair Fluid, Scratch Chip Cracks Repair Kit 2 Pack (Drakgray)

Paint Your Own Moon Lamp Kit, DIY 3D Moon Night Light with Space Figurines & Wooden Stand, Art Supplies Creativity Arts & Crafts Kit for Kids, Toys Girls Boy Birthday Easter Gift Ages 3 4 5 6 7 8 9 10 11 12+

LEGO Icons French Café Paris Building Kit - DIY Set for Adults - Collectible Bedroom and Home Decor - Display for Home or Office - Gift for Coffee Lovers - 10362

Ksipze led Lights Strip for Bedroom 100FT,Smart Music Sync RGB Color Changing with App and Remote Control, Power Supply Led Strip Lights Lumiere LED for Room Home Party Decoration

9V Battery Powered Led Kayak Strip Lights, 2 Pcs 6.56 FT RGB Color Changing Paddleboard SUP Canoes Lights, IP68 Waterproof Marine Submersible Boat Light Strip with Remote, Marine Boat Interior Light.

Transferproof Color Changing Lipstick,Gold Crystal Ph Lipstick Color Changing,Long Lasting 24 Hours Moisturizing Glossy Shine Lip Gloss for Women

