Java awt event. ActionEvent


Download 2.97 Kb.
Sana16.06.2023
Hajmi2.97 Kb.
#1499773
Bog'liq
calculator


import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

public class Calculator implements ActionListener {

boolean opr = false;
String
old;
int x = 0, i = 0;
float[] a = new float[2];
JFrame
jf;
JLabel
displayLabel;
JButton
zeroB, oneB, twoB, threeB, fourB, fiveB, sixB, sevenB, eightB, nineB, dotB, divB, mulB, minB, plusB, equalB,
clearB, sqrtB , percentB , sinB , cosB;

public Calculator() {
jf = new JFrame("Ahrorbek");
jf.getContentPane().setBackground(Color.BLACK);

jf.setLayout(null);
jf.setSize(650, 600);
jf.setLocation(500, 150);

displayLabel = new JLabel();
displayLabel.setBackground(Color.gray);
displayLabel.setOpaque(true);
displayLabel.setBounds(30, 50, 540, 50);
Download 2.97 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling