الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

أرجو المساعدة في عمل happy man بالجافا

بدأه qassim313 في 18 أبريل 2011 · 4 رد · 453 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

أنا طالب مبتدئ في الجافا وقد طلب منا عمل happy man كالشخص الذي في الصورة اسفل الموضوع فأرجو من اعضاء المنتدى الكرام والاخوة الخبراء بالجافا مساعدتي في عمل هذا البرنامج/ الكود وشاكراً لكم مقدماً اخوتي..

323594284.jpg

#2

ضع محاولاتك أولا لكى تتجنب إغلاق الموضوع

#3
هويدي كتب:

ضع محاولاتك أولا لكى تتجنب إغلاق الموضوع

import java.awt.Color;

import javax.swing.JFrame;

public class Driver {

private JFrame theWindow;

private Oval topLeftFace, topRightFace, botLeftFace, botRightFace;

/** post: a window with four happy faces is drawn */

public Driver() {

theWindow = new JFrame("The Window");

theWindow.setBounds(10, 10, 250, 250);

theWindow.setLayout(null);

theWindow.setBackground(Color.white);

theWindow.setVisible(true);

topLeftFace = new Oval(30, 10, 100, 100);

makeHappyFace(topLeftFace);

theWindow.add(topLeftFace, 0);

topLeftFace.repaint();

topRightFace = new Oval(140, 10, 100, 100);

makeHappyFace(topRightFace);

theWindow.add(topRightFace, 0);

topRightFace.repaint();

botLeftFace = new Oval(30, 120, 100, 100);

makeHappyFace(botLeftFace);

theWindow.add(botLeftFace, 0);

botLeftFace.repaint();

botRightFace = new Oval(140, 120, 100, 100);

makeHappyFace(botRightFace);

theWindow.add(botRightFace, 0);

botRightFace.repaint();

}

/** pre: f has been constructed with a radius of 100

* post: f is colored yellow

* and two black eyes are added to f

* and a black smile is added to f

*/

private void makeHappyFace( Oval f ) {

Oval leftEye, rightEye, mouth, mouthCover;

f.setBackground( Color.yellow );

mouth = new Oval( 20, 20, 60, 60 );

f.add(mouth, 0);

mouthCover = new Oval( -10, -30, 80, 80 );

mouthCover.setBackground(Color.yellow);

mouth.add(mouthCover, 0);

leftEye = new Oval( 20, 30, 15, 15 );

f.add(leftEye, 0);

rightEye = new Oval( 65, 30, 15, 15);

f.add(rightEye, 0);

}

}

هذه محاولة لعمل وجة مبتسم واني اريد عمل رجل شخص كامل الاعضاء

qassim313 كتب:

import java.awt.Color;

import javax.swing.JFrame;

public class Driver {

private JFrame theWindow;

private Oval topLeftFace, topRightFace, botLeftFace, botRightFace;

/** post: a window with four happy faces is drawn */

public Driver() {

theWindow = new JFrame("The Window");

theWindow.setBounds(10, 10, 250, 250);

theWindow.setLayout(null);

theWindow.setBackground(Color.white);

theWindow.setVisible(true);

topLeftFace = new Oval(30, 10, 100, 100);

makeHappyFace(topLeftFace);

theWindow.add(topLeftFace, 0);

topLeftFace.repaint();

topRightFace = new Oval(140, 10, 100, 100);

makeHappyFace(topRightFace);

theWindow.add(topRightFace, 0);

topRightFace.repaint();

botLeftFace = new Oval(30, 120, 100, 100);

makeHappyFace(botLeftFace);

theWindow.add(botLeftFace, 0);

botLeftFace.repaint();

botRightFace = new Oval(140, 120, 100, 100);

makeHappyFace(botRightFace);

theWindow.add(botRightFace, 0);

botRightFace.repaint();

}

/** pre: f has been constructed with a radius of 100

* post: f is colored yellow

* and two black eyes are added to f

* and a black smile is added to f

*/

private void makeHappyFace( Oval f ) {

Oval leftEye, rightEye, mouth, mouthCover;

f.setBackground( Color.yellow );

mouth = new Oval( 20, 20, 60, 60 );

f.add(mouth, 0);

mouthCover = new Oval( -10, -30, 80, 80 );

mouthCover.setBackground(Color.yellow);

mouth.add(mouthCover, 0);

leftEye = new Oval( 20, 30, 15, 15 );

f.add(leftEye, 0);

rightEye = new Oval( 65, 30, 15, 15);

f.add(rightEye, 0);

}

}

تم تعديل هذه المشاركة بواسطة qassim313 في 18 أبريل 2011 في 13:31

#4

الكود ينقصة الOval class

لكن بم انك حاولت رسم الوجهه واشتغل معاك

فكمل اخى الكريم

على هذا المنوال

مع تغيير قيم الـ x , y حسب مكان ما تريد

واختار الشكل المناسب للرسم سواء Line , Circle , Rectangle , ....

بالتوفيق

Software Developer
Mahmoudkelany.com


 

#5

اخي الكريم انا عملت الوجه بالكود الي فوق ولكن ذلك الكود حصلته من النت ولم اعمله بنفسي لذا كان صعباً علي اكمال الباقي من الجسد وغيره وهذا ما دفعني لطلب المساعدة..لذا اذا كان لديك الوقت الرجاء المساعدة..

Mahmoud Kelany كتب:

الكود ينقصة الOval class

لكن بم انك حاولت رسم الوجهه واشتغل معاك

فكمل اخى الكريم

على هذا المنوال

مع تغيير قيم الـ x , y حسب مكان ما تريد

واختار الشكل المناسب للرسم سواء Line , Circle , Rectangle , ....

بالتوفيق

مواضيع مشابهة