ملك الاحزان
06-12-2004, 06:58 PM
السلام عليكم ورحمة الله وبركاتة
تكفون ساعدوني
ابغى برنامج بلغة الجافا يعمل مثل الاله الحاسبةفي الاعداد
في الجمع والطرح والقسمه
تكفون في اقرب وقت
كود الاله الحاسبه
ولكم تحياتي
ابو وديع
06-12-2004, 08:06 PM
السلام عليكم
هدا مشروع الاله الحاسبه قمت بعمله وتسليمه السنه السابقه
مقدم من المهندس ابو وديع(عاشق سلطان الطرب)
شكرا
ملك الاحزان
07-12-2004, 09:05 PM
الف شكر اخوى
ابو وديع(عاشق سلطان الطرب)
ولك تحياتي
خالد oo
04-11-2006, 08:03 PM
السلام عليكم ورحمه الله وبركاته
ممكن لو سمحتو تساعدوني في عمل اكواد الاله الحاسبه
وشكرأ
mma_1122@hotmail.com
هذا البرنامج لاكن فيه اخطاء ممكن تساا عدوووني في حلهااا وشكرأ بعض الاكوواد ماا تعمل
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Frame1 extends JFrame **
int num,nu,result;
char operation;
JPanel contentPane;
JTextField Display = new JTextField();
JButton num7 = new JButton();
JButton num8 = new JButton();
JButton num9 = new JButton();
JButton num4 = new JButton();
JButton num5 = new JButton();
JButton num6 = new JButton();
JButton num1 = new JButton();
JButton num2 = new JButton();
JButton num3 = new JButton();
JButton num0 = new JButton();
JButton jButton11 = new JButton();
JButton sum = new JButton();
JButton sub = new JButton();
JButton jButton14 = new JButton();
JButton jButton16 = new JButton();
JButton jButton17 = new JButton();
JButton jButton18 = new JButton();
JTextPane jTextPane1 = new JTextPane();
//Construct the frame
public Frame1() **
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try **
jbInit();
}
catch(Exception e) **
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception **
contentPane = (JPanel) this.getContentPane();
Display.setBackground(Color.red);
Display.setText("");
Display.setBounds(new Rectangle(27, 36, 184, 26));
Display.addActionListener(new Frame1_Display_actionAdapter(this));
contentPane.setLayout(null);
this.setSize(new Dimension(264, 227));
this.setTitle("Frame Title");
num7.setBackground(Color.blue);
num7.setBounds(new Rectangle(29, 67, 47, 29));
num7.setText("7");
num7.addActionListener(new Frame1_num7_actionAdapter(this));
num8.setBackground(Color.blue);
num8.setBounds(new Rectangle(88, 67, 47, 29));
num8.setText("8");
num8.addActionListener(new Frame1_num8_actionAdapter(this));
num9.setBackground(Color.blue);
num9.setBounds(new Rectangle(147, 67, 47, 29));
num9.setText("9");
num9.addActionListener(new Frame1_num9_actionAdapter(this));
num4.setBackground(Color.blue);
num4.setBounds(new Rectangle(29, 107, 47, 29));
num4.setText("4");
num4.addActionListener(new Frame1_num4_actionAdapter(this));
num5.setBackground(Color.blue);
num5.setBounds(new Rectangle(88, 107, 47, 29));
num5.setText("5");
num5.addActionListener(new Frame1_num5_actionAdapter(this));
num6.setBackground(Color.blue);
num6.setBounds(new Rectangle(147, 107, 47, 29));
num6.setText("6");
num6.addActionListener(new Frame1_num6_actionAdapter(this));
num1.setBackground(Color.blue);
num1.setBounds(new Rectangle(27, 145, 47, 29));
num1.setText("1");
num1.addActionListener(new Frame1_num1_actionAdapter(this));
num2.setBackground(Color.blue);
num2.setBounds(new Rectangle(88, 146, 47, 29));
num2.setText("2");
num2.addActionListener(new Frame1_num2_actionAdapter(this));
num3.setBackground(Color.blue);
num3.setBounds(new Rectangle(147, 146, 47, 29));
num3.setText("3");
num3.addActionListener(new Frame1_num3_actionAdapter(this));
num0.setBackground(Color.blue);
num0.setBounds(new Rectangle(28, 181, 104, 29));
num0.setText("0");
num0.addActionListener(new Frame1_num0_actionAdapter(this));
jButton11.setBackground(Color.blue);
jButton11.setBounds(new Rectangle(148, 182, 47, 29));
jButton11.setText("=");
sum.setBackground(Color.blue);
sum.setBounds(new Rectangle(207, 67, 47, 29));
sum.setText("+");
sum.addActionListener(new Frame1_sum_actionAdapter(this));
sub.setBackground(Color.blue);
sub.setBounds(new Rectangle(208, 104, 47, 29));
sub.setText("*");
jButton14.setBackground(Color.blue);
jButton14.setBounds(new Rectangle(209, 146, 47, 29));
jButton14.setText("/");
jButton16.setBounds(new Rectangle(28, 67, 47, 29));
jButton16.setText("jButton16");
jButton17.setBounds(new Rectangle(87, 68, 46, 27));
jButton17.setText("jButton17");
jButton18.setBounds(new Rectangle(146, 72, 39, 24));
jButton18.setText("jButton18");
jTextPane1.setBackground(Color.blue);
jTextPane1.setFont(new java.awt.Font("Serif", 0, 18));
jTextPane1.setForeground(SystemColor.activeCaption Text);
jTextPane1.setSelectedTextColor(Color.white);
jTextPane1.setText("الالــــه الـــحــــاســـبــــه");
jTextPane1.setBounds(new Rectangle(40, 7, 161, 23));
contentPane.setBackground(UIManager.getColor("InternalFrame.inactiveTitleBackground"));
contentPane.add(num7, null);
contentPane.add(num8, null);
contentPane.add(num9, null);
contentPane.add(num4, null);
contentPane.add(num5, null);
contentPane.add(num6, null);
contentPane.add(jButton16, null);
contentPane.add(jButton17, null);
contentPane.add(jButton18, null);
contentPane.add(sum, null);
contentPane.add(sub, null);
contentPane.add(jButton14, null);
contentPane.add(num3, null);
contentPane.add(num2, null);
contentPane.add(num1, null);
contentPane.add(num0, null);
contentPane.add(jButton11, null);
contentPane.add(Display, null);
contentPane.add(jTextPane1, null);
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) **
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) **
System.exit(0);
}
}
void num1_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"1");
}
void num2_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"2");
}
void num3_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"3");
}
void num4_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"4");
}
void num5_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"5");
}
void num6_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"6");
}
void num7_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"7");
}
void num8_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"8");
}
void num9_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"9");
}
void num0_actionPerformed(ActionEvent e) **
Display.setText(Display.getText()+"0");
switch(operation)**
case '+':
result=num+nu;
break;
case '*':
result=num*nu;
break;
case '/':
result=num/nu;
break;
default:
Display.setText(Display.getText()+"error");
}
}
void sum_actionPerformed(ActionEvent e) **
}
void display_actionPerformed(ActionEvent e) **
}
}
class Frame1_num1_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num1_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num1_actionPerformed(e);
}
}
class Frame1_num2_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num2_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num2_actionPerformed(e);
}
}
class Frame1_num3_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num3_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num3_actionPerformed(e);
}
}
class Frame1_num4_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num4_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num4_actionPerformed(e);
}
}
class Frame1_num5_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num5_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num5_actionPerformed(e);
}
}
class Frame1_num6_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num6_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num6_actionPerformed(e);
}
}
class Frame1_num7_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num7_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num7_actionPerformed(e);
}
}
class Frame1_num8_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num8_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num8_actionPerformed(e);
}
}
class Frame1_num9_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num9_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num9_actionPerformed(e);
}
}
class Frame1_num0_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_num0_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.num0_actionPerformed(e);
}
}
class Frame1_sum_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_sum_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.sum_actionPerformed(e);
}
}
class Frame1_text_actionAdapter implements java.awt.event.ActionListener **
Frame1 adaptee;
Frame1_text_actionAdapter(Frame1 adaptee) **
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) **
adaptee.display_actionPerformed(e);
}
}