/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
import javax.swing.*;
import java.awt.GridLayout;
/**
*
* @author dell
*/
public class JavaApplication2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
JPanel wC =new JPanel();
GridLayout gl= new GridLayout (4,2);
wC.setLayout(gl);
JLabel label1=new JLabel("1. sayı:");
JTextField yazi1=new JTextField(10);
JLabel label2=new JLabel("2. sayı:");
JTextField yazi2=new JTextField(10);
JLabel label3=new JLabel("Toplam");
JTextField toplam=new JTextField(10);
JButton OK=new JButton("Topla");
wC.add(label1);
wC.add(yazi1);
wC.add(label2);
wC.add(yazi2);
wC.add(label3);
wC.add(toplam);
wC.add(OK);
JFrame sayfa=new JFrame("Haydi Topla!!");
sayfa.setContentPane(wC);
sayfa.setSize(375,150);
sayfa.setVisible(true);
}
}
arkadaşlar butona bastığımızda toplama işlemini yapabilecek kodu yazabilir misiniz? Şimdiden teşekkürler
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
import javax.swing.*;
import java.awt.GridLayout;
/**
*
* @author dell
*/
public class JavaApplication2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
JPanel wC =new JPanel();
GridLayout gl= new GridLayout (4,2);
wC.setLayout(gl);
JLabel label1=new JLabel("1. sayı:");
JTextField yazi1=new JTextField(10);
JLabel label2=new JLabel("2. sayı:");
JTextField yazi2=new JTextField(10);
JLabel label3=new JLabel("Toplam");
JTextField toplam=new JTextField(10);
JButton OK=new JButton("Topla");
wC.add(label1);
wC.add(yazi1);
wC.add(label2);
wC.add(yazi2);
wC.add(label3);
wC.add(toplam);
wC.add(OK);
JFrame sayfa=new JFrame("Haydi Topla!!");
sayfa.setContentPane(wC);
sayfa.setSize(375,150);
sayfa.setVisible(true);
}
}
arkadaşlar butona bastığımızda toplama işlemini yapabilecek kodu yazabilir misiniz? Şimdiden teşekkürler