Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package edno;
- import java.awt.EventQueue;
- import java.awt.Label;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- import javax.swing.JTextField;
- import javax.swing.text.StyledEditorKit.ForegroundAction;
- import org.w3c.dom.ranges.DocumentRange;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- import javax.swing.JLabel;
- public class gpida {
- private JFrame frame;
- private JTextField textField;
- private JTextField textField_1;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- gpida window = new gpida();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public gpida() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setBounds(100, 100, 450, 300);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(null);
- textField = new JTextField();
- textField.setBounds(10, 95, 86, 20);
- frame.getContentPane().add(textField);
- textField.setColumns(10);
- JLabel lblNewLabel = new JLabel("New label");
- lblNewLabel.setBounds(37, 190, 180, 14);
- frame.getContentPane().add(lblNewLabel);
- textField_1 = new JTextField();
- textField_1.setBounds(106, 95, 86, 20);
- frame.getContentPane().add(textField_1);
- textField_1.setColumns(10);
- JButton btnNasturjiiiiiiiiiiiiii = new JButton("");
- btnNasturjiiiiiiiiiiiiii.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- int a = Integer.parseInt(textField.getText());
- int b = Integer.parseInt(textField_1.getText());
- double arr[] = new double[a];
- // double arr[]=new double[b];
- int total = 1;
- for (int i = a; i <= b; i++) {
- if (i % 3 == 0) {
- total *= i;
- }
- }
- if (total == 1) {
- lblNewLabel.setText("Nqma Proizvedenie");
- } else {
- lblNewLabel.setText("Proizvedenieto e " + total);
- }
- }
- });
- btnNasturjiiiiiiiiiiiiii.setBounds(10, 126, 180, 23);
- frame.getContentPane().add(btnNasturjiiiiiiiiiiiiii);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement