NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package event;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import java.awt.event.*;
import java.awt.*;

public class CalHiih extends JFrame implements ActionListener {
private JButton b1;
private JTextField tf1, tf2;
private JLabel lb1, lb2, lb3;


public CalHiih() {
lb1= new JLabel("too 1:");
lb1.setBounds(40, 40, 80,30);

lb2= new JLabel("too 2:");
lb2.setBounds(40, 80, 80,30);
//lb1.setForeground(Color.red);

lb3= new JLabel("hariu ");
lb3.setBounds(130, 160, 120,30);

tf1= new JTextField();
tf1.setBounds(130, 40, 120, 30);

tf2= new JTextField();
tf2.setBounds(130, 80, 120, 30);

b1= new JButton("add");
b1.setBounds(130, 120, 120, 30);
b1.addActionListener(this);

this.add(lb1);
this.add(lb2);
this.add(lb3);
this.add(b1);
this.add(tf1);
this.add(tf2);
this.setSize(400,400);
this.setLayout(null);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}



@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub

if(e.getSource()==b1) {
try {
String t1 = tf1.getText();
String t2 = tf2.getText();
int niilber = Integer.parseInt(t1)+Integer.parseInt(t2);
lb3.setText("Hariu : " +niilber);
}
catch (NumberFormatException n)
{
System.out.println("please enter number");
JOptionPane.showMessageDialog(null, "enter number" );
}
}
}
}
----------------------------------------------------

package event;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.event.*;
import java.awt.*;

public class ActionHiih extends JFrame implements ActionListener {
private JButton b1;
private JButton b2;
private JTextField tf;
private JLabel lb1;
int i=0;

public ActionHiih() {
lb1= new JLabel("Txt");
lb1.setBounds(40, 90, 100,30);
lb1.setForeground(Color.red);

tf= new JTextField();
tf.setBounds(150, 50, 120, 30);

b1= new JButton("click");
b1.setBounds(40, 50, 100, 30);
b1.addActionListener(this);

b2= new JButton ("clear");
b2.setBounds(40, 130, 100, 30);
b2.addActionListener(this);

this.add(lb1);
this.add(b1);
this.add(b2);
this.add(tf);
this.setSize(400,400);
this.setLayout(null);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if (e.getSource()==b1) {
String txt = tf.getText();
lb1.setText(txt);
}
if (e.getSource()==b2) {


lb1.setText("Text");
tf.setText(" ");
}

// if(e.getSource()==b1) {
// System.out.println(b1.getText()+" "+i);
// b1.setText("");
// b1.setText("clicked "+i);
// i++;
}
}
---------------------------------------------

package event;

public class EventHiih {

public static void main(String[] args) {
// TODO Auto-generated method stub
//ActionHiih ah = new ActionHiih();
CalHiih cl= new CalHiih();

}

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.