[Java] Calculator program creation 1

Purpose

It's been about a month since I learned Java by myself, and I want to create a GUI application using Java, so I'll try to create a calculator application. This time, we will first create the appearance of the calculator application.

reference

▼ Website ・ Let's Programming-Let's use Swing -Programming starting with Java-Chapter 12 Let's make a calculator -Class BorderLayout

usage environment

OS:Mac Language: JavaSE 1.8 Eclipse

Deliverables

The website that I referred to when creating the program Programming starting with Java

Created program

image.png Lines 1-8: Import necessary libraries, etc.

image.png image.png Lines 18-21: Frame generation (frame title, frame size, etc.)

Lines 22-25: Generate text box

Lines 27-51: Generation of numeric keypad. Buttons such as numerical values are arranged on a 4x4 grid.

Execution result

image.png Next time, we will create processing for buttons such as number buttons.

Recommended Posts

[Java] Calculator program creation 1
Calculator program
java file creation
java directory creation
Eclipse ~ Java project creation ~
Java Discord Bot creation
[Java] Creation of original annotation
Null-safe program in Java (Eclipse)
Play Framework 2.6 (Java) development environment creation
Java
Java
[Introduction to Java] How to write a Java program
[Java] How to measure program execution time
Try making a calculator app in Java
Program PDF headers and footers in Java
Effective Java 3rd Edition Chapter 9 Program General
[Improvement] Learn Java through simple tool creation