Jump to content
Forumu Destekleyenlere Katılın ×
Paticik Forumları
2000 lerden beri faal olan, çok şukela bir paylaşım platformuyuz. Hoşgeldiniz.

JAVA projesi=hesap makinası=son gün=ya lütfen yardım


Archie_81

Öne çıkan mesajlar

beyler bu progrma neden çalışmıyor bilen varmı? tıkandım artık daha fazla olmuyor.yardım ederseniz sevinirim...

[code=php]
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Calculator extends JFrame implements ActionListener
{
private JLabel view;
ImageIcon about_image;
private JMenu menu;
private JMenuItem menuItem,exit;
private int p;
private double res,pow;
private JButton zero,one,two,three,four,five,six,seven,eight,nine,dot,equal,clear;
private JButton add,sub,div,mult,sin,cos,tan,inv,xy,fact;
private JTextField input;
private JComboBox a,team;
private JMenuBar bar;

private JRadioButton std,scf;
private JPanel extendalt,extendust;
private String first,second;
Calculator()
{
super("Calculator");
Container c=getContentPane();
c.setLayout(null);

first=new String();
second=new String();

p=0;
res=0;

JMenuBar bar = new JMenuBar();

std=new JRadioButton("Standard",true);
scf=new JRadioButton("Scientific");
ButtonGroup bg=new ButtonGroup();
bg.add(std);
bg.add(scf);

a=new JComboBox();
a.addActionListener(this);
a.addItem("Choose text color");
a.addItem("Yellow");
a.addItem("Blue");
a.addItem("Red");
a.addItem("Black");


team=new JComboBox();
team.addActionListener(this);
team.addItem("Select team ");
team.addItem("Fenerbahce");
team.addItem("Besiktas");
team.addItem("Galatasaray");

menu=new JMenu("Application");
exit=new JMenuItem("Exit");
menuItem=new JMenuItem("About");
menu.add(menuItem);
menu.add(exit);

view=new JLabel("View");

input=new JTextField(19);
//input2=new JTextField(19);

clear=new JButton("Clear");
equal=new JButton("=");
dot=new JButton(".");
zero=new JButton("0");
one=new JButton("1");
two=new JButton("2");
three=new JButton("3");
four=new JButton("4");
five=new JButton("5");
six=new JButton("6");
seven=new JButton("7");
eight=new JButton("8");
nine=new JButton("9");

add=new JButton("+");
sub=new JButton("-");
mult=new JButton("*");
div=new JButton("/");

one.addActionListener(this);
two.addActionListener(this);
three.addActionListener(this);
four.addActionListener(this);
five.addActionListener(this);
six.addActionListener(this);
seven.addActionListener(this);
eight.addActionListener(this);
nine.addActionListener(this);
zero.addActionListener(this);
dot.addActionListener(this);
add.addActionListener(this);
sub.addActionListener(this);
equal.addActionListener(this);
mult.addActionListener(this);
div.addActionListener(this);
clear.addActionListener(this);


//menu.setBounds(5,5,100,15);
//c.add(menu);


bar.setBounds(5,5,10,15);

bar.add(menu);
setJMenuBar(bar);
//c.add(bar);
menuItem.addActionListener(this);
exit.addActionListener(this);



team.setBounds(120,5,150,20);
c.add(team);

input.setBounds(20,30,250,18);
//input2.setBounds(20,30,250,18);
//c.add(input2);
//input2.setVisible(false);
c.add(input);
a.setBounds(20,50,180,20);
c.add(a);
clear.setBounds(200,50,70,20);
c.add(clear);
seven.setBounds(20,75,50,20);
c.add(seven);
eight.setBounds(80,75,50,20);
c.add(eight);
nine.setBounds(140,75,50,20);
c.add(nine);
div.setBounds(200,75,70,20);
c.add(div);
four.setBounds(20,100,50,20);
c.add(four);
five.setBounds(80,100,50,20);
c.add(five);
six.setBounds(140,100,50,20);
c.add(six);
mult.setBounds(200,100,70,20);
c.add(mult);
one.setBounds(20,125,50,20);
c.add(one);
two.setBounds(80,125,50,20);
c.add(two);
three.setBounds(140,125,50,20);
c.add(three);
sub.setBounds(200,125,70,20);
c.add(sub);
zero.setBounds(20,150,50,20);
c.add(zero);
dot.setBounds(80,150,50,20);
c.add(dot);
equal.setBounds(140,150,50,20);
c.add(equal);
add.setBounds(200,150,70,20);
c.add(add);
view.setBounds(40,175,30,10);
c.add(view);
std.setBounds(30,185,100,40);
c.add(std);
scf.setBounds(135,185,100,40);
c.add(scf);

std.addActionListener(this);
scf.addActionListener(this);

sin=new JButton("sin");
cos=new JButton("cos");
tan=new JButton("tan");
inv=new JButton("1/x");
xy=new JButton("x^y");
fact=new JButton("n!");

sin.addActionListener(this);
cos.addActionListener(this);
tan.addActionListener(this);
inv.addActionListener(this);
xy.addActionListener(this);
fact.addActionListener(this);

sin.setBounds(30,250,55,20);
c.add(sin);
cos.setBounds(100,250,55,20);
c.add(cos);
tan.setBounds(170,250,55,20);
c.add(tan);


inv.setBounds(30,275,55,20);
c.add(inv);
xy.setBounds(100,275,55,20);
c.add(xy);
fact.setBounds(170,275,55,20);

c.add(fact);





setSize(300,300);
setVisible(true);

}

public void ac
Link to comment
Sosyal ağlarda paylaş

nesi calismiyo abicim bunun?
ne yapinca sorun cikariyo yani?

anladim sanirim, esittir dedikten sonra, bi rakama basinca sonucun yanina yazmaya basliyo rakami... bu mudur sorun?

NOT:bu isi tek bi class'ta yapmisin ya, yuh yani, ondan zaten calisacagi varsa da calismaz...[signature][hline][Golden Horde]Goyal Xar

[Bu mesaj riglous tarafından 20 Aralık 2004 08:36 tarihinde değiştirilmiştir]
Link to comment
Sosyal ağlarda paylaş

×
×
  • Yeni Oluştur...