اذهب إلى المحتوى

لينا الزعبي

الأعضاء
  • المساهمات

    40
  • تاريخ الانضمام

  • تاريخ آخر زيارة

آخر الزوار

لوحة آخر الزوار معطلة ولن تظهر للأعضاء

إنجازات لينا الزعبي

عضو مساهم

عضو مساهم (2/3)

33

السمعة بالموقع

  1. السلام عليكم ، هل يوجد امتحانات نقييم بها نفسنا بعد مرحلة معينة او لا يوجد غير النهائي؟
  2. java.io.FileNotFoundException: C:\Users\User\Desktop\al kouds.mp3 (The system cannot find the file specified) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at com.sun.media.sound.WaveFloatFileReader.getAudioInputStream(WaveFloatFileReader.java:168) at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1181) at Drapeaux.<init>(Drapeaux.java:26) at Drapeaux.main(Drapeaux.java:129) هذا هو ال error Drapeaux.java import java.awt.*; import java.awt.event.*; import java.io.*; import javax.sound.sampled.*; import javax.swing.*; public class Drapeaux extends JPanel implements ActionListener { private int flag = 0; // Indicateur pour savoir quel drapeau doit être affiché (0 = Liban, 1 = Palestine, 2 = Arabie Saoudite) private Clip clip; // Objet pour jouer la chanson private boolean showMan = false; // Indicateur pour savoir si l'homme doit être affiché public Drapeaux() { try { // Charger le fichier audio File file = new File(System.getProperty("user.home") + File.separator + "Desktop" + File.separator + "al kouds.mp3"); AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file); clip = AudioSystem.getClip(); clip.open(audioInputStream); } catch (Exception e) { e.printStackTrace(); } } public void paintComponent(Graphics g) { super.paintComponent(g); int width = getWidth(); int height = getHeight(); if (flag == 1) { // Dessiner le drapeau de la Palestine g.setColor(Color.BLACK); g.fillRect(0, 0, width, height / 3); g.setColor(Color.WHITE); g.fillRect(0, height / 3, width, height / 3); g.setColor(Color.GREEN); g.fillRect(0, height * 2 / 3, width, height / 3); g.setColor(Color.RED); int[] xPoints = {0, width / 4, 0}; int[] yPoints = {0, height / 2, height}; g.fillPolygon(xPoints, yPoints, 3); } else if (flag == 2) { // Dessiner le drapeau de l'Arabie Saoudite g.setColor(new Color(0x006C35)); g.fillRect(0, 0, width, height); // Dessiner l'épée g.setColor(Color.WHITE); int swordY = height * 2 / 3; int swordWidth = width * 2 / 3; int swordHeight = height / 40; int swordX = (width - swordWidth) / 2; g.fillRect(swordX, swordY, swordWidth, swordHeight); // Dessiner l'inscription Font font = new Font("Thuluth", Font.PLAIN, height / 4); g.setFont(font); FontMetrics metrics = g.getFontMetrics(font); String text = "لا إله إلا الله محمد رسول الله"; int textX = (width - metrics.stringWidth(text)) / 2; int textY = swordY - metrics.getHeight() + metrics.getAscent(); g.drawString(text, textX, textY); } else { // Dessiner le drapeau du Liban g.setColor(Color.RED); g.fillRect(0 ,0 ,width ,height); g.setColor(Color.WHITE); g.fillRect(0 ,height/3 ,width ,height/3); g.setColor(Color.GREEN); int treeHeight=height/3; int treeWidth=treeHeight/2; int treeX=(width-treeWidth)/2; int treeY=(height-treeHeight)/2; g.fillOval(treeX ,treeY ,treeWidth ,treeHeight); } if (showMan) { // Dessiner le corps g.setColor(Color.BLACK); g.drawLine(width / 2 ,height/4 ,width/2 ,height*3/4); // Dessiner les jambes g.drawLine(width/2 ,height*3/4 ,width*3/8 ,height); g.drawLine(width/2 ,height*3/4 ,width*5/8 ,height); // Dessiner les bras g.drawLine(width/2 ,height/2 ,width*3/8 ,height*1/4); g.drawLine(width/2 ,height/2 ,width*5/8 ,height*1/4); // Dessiner la tête g.drawOval(width*7/16,height/8,width/8,height/8); } } public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Afficher la Palestine")) { flag =(flag ==1 ) ? flag :1 ; repaint(); } else if (e.getActionCommand().equals("Afficher l'Arabie Saoudite")) { flag =(flag ==2 ) ? flag :2 ; repaint(); } else if (e.getActionCommand().equals("Jouer la chanson")) { if(clip != null){ clip.setFramePosition(0); clip.start(); } } else if(e.getActionCommand().equals("Afficher l'homme")){ showMan=!showMan; } else if(e.getActionCommand().equals("Afficher le Liban")){ flag=0; } repaint(); } public static void main(String[] args){ JFrame frame= new JFrame("Drapeaux"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400 ,300); Drapeaux drapeaux= new Drapeaux(); frame.add(drapeaux); JPanel buttonsPanel= new JPanel(); frame.add(buttonsPanel , BorderLayout.SOUTH); JButton button1= new JButton("Afficher la Palestine"); button1.addActionListener(drapeaux); buttonsPanel.add(button1); JButton button2= new JButton("Afficher l'Arabie Saoudite"); button2.addActionListener(drapeaux); buttonsPanel.add(button2); JButton button3= new JButton("Jouer la chanson"); button3.addActionListener(drapeaux); buttonsPanel.add(button3); JButton button4= new JButton("Afficher l'homme"); button4.addActionListener(drapeaux); buttonsPanel.add(button4); JButton button5= new JButton("Afficher le Liban"); button5.addActionListener(drapeaux); buttonsPanel.add(button5); frame.setVisible(true); } } بعد التعديل
  3. للأسف مازالت المشكلة، لقد غيرت إلى mp3 وضل ال error. حتى أني غيرت اسمه الىmp3 بال desktop
  4. طيب صغرت الإسم وهو موجود على ال deaktop وكتبت هكذا بالكود، ومازال ال error. وفي الصورة موجود ان الأغنية على ال desktop
  5. import java.awt.*; import java.awt.event.*; import java.io.*; import javax.sound.sampled.*; import javax.swing.*; public class Drapeaux extends JPanel implements ActionListener { private int flag = 0; // Indicateur pour savoir quel drapeau doit être affiché (0 = Liban, 1 = Palestine, 2 = Arabie Saoudite) private Clip clip; // Objet pour jouer la chanson private boolean showMan = false; // Indicateur pour savoir si l'homme doit être affiché public Drapeaux() { try { // Charger le fichier audio File file = new File(System.getProperty("user.home") + File.separator + "Desktop" + File.separator + "أغنيه الأرض لنا والقدس لنا بدون موسيقى وبدون ايقاع (256 kbps) (shabakngy.com).mp3"); AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file); clip = AudioSystem.getClip(); clip.open(audioInputStream); } catch (Exception e) { e.printStackTrace(); } } public void paintComponent(Graphics g) { super.paintComponent(g); int width = getWidth(); int height = getHeight(); if (flag == 1) { // Dessiner le drapeau de la Palestine g.setColor(Color.BLACK); g.fillRect(0, 0, width, height / 3); g.setColor(Color.WHITE); g.fillRect(0, height / 3, width, height / 3); g.setColor(Color.GREEN); g.fillRect(0, height * 2 / 3, width, height / 3); g.setColor(Color.RED); int[] xPoints = {0, width / 4, 0}; int[] yPoints = {0, height / 2, height}; g.fillPolygon(xPoints, yPoints, 3); } else if (flag == 2) { // Dessiner le drapeau de l'Arabie Saoudite g.setColor(new Color(0x006C35)); g.fillRect(0, 0, width, height); // Dessiner l'épée g.setColor(Color.WHITE); int swordY = height * 2 / 3; int swordWidth = width * 2 / 3; int swordHeight = height / 40; int swordX = (width - swordWidth) / 2; g.fillRect(swordX, swordY, swordWidth, swordHeight); // Dessiner l'inscription Font font = new Font("Thuluth", Font.PLAIN, height / 4); g.setFont(font); FontMetrics metrics = g.getFontMetrics(font); String text = "لا إله إلا الله محمد رسول الله"; int textX = (width - metrics.stringWidth(text)) / 2; int textY = swordY - metrics.getHeight() + metrics.getAscent(); g.drawString(text, textX, textY); } else { // Dessiner le drapeau du Liban g.setColor(Color.RED); g.fillRect(0 ,0 ,width ,height); g.setColor(Color.WHITE); g.fillRect(0 ,height/3 ,width ,height/3); g.setColor(Color.GREEN); int treeHeight=height/3; int treeWidth=treeHeight/2; int treeX=(width-treeWidth)/2; int treeY=(height-treeHeight)/2; g.fillOval(treeX ,treeY ,treeWidth ,treeHeight); } if (showMan) { // Dessiner le corps g.setColor(Color.BLACK); g.drawLine(width / 2 ,height/4 ,width/2 ,height*3/4); // Dessiner les jambes g.drawLine(width/2 ,height*3/4 ,width*3/8 ,height); g.drawLine(width/2 ,height*3/4 ,width*5/8 ,height); // Dessiner les bras g.drawLine(width/2 ,height/2 ,width*3/8 ,height*1/4); g.drawLine(width/2 ,height/2 ,width*5/8 ,height*1/4); // Dessiner la tête g.drawOval(width*7/16,height/8,width/8,height/8); } } public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Afficher la Palestine")) { flag =(flag ==1 ) ? flag :1 ; repaint(); } else if (e.getActionCommand().equals("Afficher l'Arabie Saoudite")) { flag =(flag ==2 ) ? flag :2 ; repaint(); } else if (e.getActionCommand().equals("Jouer la chanson")) { if(clip != null) { clip.setFramePosition(0); clip.start(); } } else if(e.getActionCommand().equals("Afficher l'homme")) { showMan=!showMan; } else if(e.getActionCommand().equals("Afficher le Liban")) { flag=0; } repaint(); } public static void main(String[] args) { JFrame frame= new JFrame("Drapeaux"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400 ,300); Drapeaux drapeaux= new Drapeaux(); frame.add(drapeaux); JPanel buttonsPanel= new JPanel(); frame.add(buttonsPanel , BorderLayout.SOUTH); JButton button1= new JButton("Afficher la Palestine"); button1.addActionListener(drapeaux); buttonsPanel.add(button1); JButton button2= new JButton("Afficher l'Arabie Saoudite"); button2.addActionListener(drapeaux); buttonsPanel.add(button2); JButton button3= new JButton("Jouer la chanson"); button3.addActionListener(drapeaux); buttonsPanel.add(button3); JButton button4= new JButton("Afficher l'homme"); button4.addActionListener(drapeaux); buttonsPanel.add(button4); JButton button5= new JButton("Afficher le Liban"); button5.addActionListener(drapeaux); buttonsPanel.add(button5); frame.setVisible(true); } } الذي فوق هو الكود والذي في الصورة هو ال error
  6. لا هو البرنامج اسمو proton IDE نستخدمه لبرمجة الشرائح الإليكترونية هذا هو proton compiler
  7. السلام عليكم ورحمة الله وبركاته، اننا نعمل بالجامعة على تسهيل لغة ال microcontrôleur من assembly language الى تحولها لبرنامج proton plus حتى تكون أسهل. لكن للأسف نزلت نسخة وعندما أضغط على run يعطيني error مكتوب فيه missing secuirty key. كيف أحل المشكلة ؟؟
  8. السلام عليكم ورحمة الله وبركاته. انا ادرس بالجامعة اختصاص اليكترونيك والناس تنصحني بدورة python وتقول لي هي أهم لي من javascript حسب اختصاصي. أريد استشارة منكم هل هذا صحيح؟ وهل يمكنني ان اغير دورة ال javascript الى دورة python?
  9. نعم أقصد على فيديو بالدورة بس لو سمحت ممكن تقل لي يعني أين أجد ختنة الأسئلة تحت الفيديو؟
  10. قمت بجميع ما فعله الأستاذ بالفيديو لتثبيت البرنامج ولم أستطع فتح البرنامج بعد تثبيته أنا معي windows 7
×
×
  • أضف...