└── Calculator using java /Calculator using java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.*; 3 | 4 | public class Calculator { 5 | JFrame frame;//Creating object of JFrame class 6 | Calculator()//Creating constructor of the class 7 | { 8 | prepareGUI(); 9 | } 10 | public void prepareGUI() 11 | { 12 | frame=new JFrame(); 13 | frame.setTitle("Calculator");//Setting title of the JFrame 14 | frame.setSize(300,490);//Setting size 15 | frame.getContentPane().setLayout(null);//Setting Layout 16 | frame.getContentPane().setBackground(Color.black);//Setting Background Color 17 | frame.setResizable(false);//Preventing window from resizing 18 | frame.setLocationRelativeTo(null);//Setting location to the center of the screen 19 | frame.setVisible(true);//Setting window's visibility 20 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//Setting default close operation 21 | } 22 | } 23 | --------------------------------------------------------------------------------