java calculator

4 Comments

Java Program for calculator

JPanel p = new JPanel();
p.setLayout(new GridLayout(4, 4));
String buttons = “789/456*123-0.=+”;
for (int i = 0; i < buttons.length(); i++) addButton(p, buttons.substring(i, i + 1)); add(p, "Center");

85 Comments

Java applet program for calculator

Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the + – * % operations.Add a text field to display the result.