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

تصميم برنامج جافا صغييير هل من مساعد..؟؟

مغلق
بدأه الواكد في 18 يناير 2003 · 8 رد · 1,112 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

أكتب برنامج بواسطة لغة الجافا طبعاً.... يقوم برسم مثلث مملوء باللون الأخضر ومكتوب بداخله كلمة لا إله إلا الله باللون الأبيض...؟؟

#2

بالنسبه للمثلث :rolleyes: ... مش عارف اذا في داله جاهزه للمثلث !!

لكن تلقى للدائره و المربع و المربع بدون زوايا ... لكن المثلث !! ما دورت عنه

بالنسبه للكتابه،،،، فالى الحين ما استطعت اكتب عربي داخل الجافا :(

#3

شكرا أخ صلاح على كل حال.... بس انا ارغب في الكود

واعتقد هناك أمكانية للكتابة باللغة العربية داخل الجافا..؟

#5

بسم الله الرحمن الرحيم

أخ واكد معذرة أنى أضطررت لحذف ردك الأخير لخروجه على نهج الفريق.

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

شكرا

فتــ الجافا ــى

#6

this is just an example

import java.awt.*;
import java.applet.*;

public class Applet1 extends Applet {

  public void paint(Graphics g){

    g.setColor(new Color( 33,138,46));
    g.drawLine(200,50,270,200);
    g.drawLine(200,50,100,200);
    g.drawLine(270,200,100,200);
    g.setColor(new Color(220,116,31));
    g.drawString("write what you want",135,190);
  }

}
#7

هل استطيع ان اكتب بالعربية داخل كود الجافا و يظهر بشكل سليم ؟

وشكراً

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why

#8

yes you can

I didn't try that in applet but I am sure you can

I just have made a little test for you in JFrame

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

public class Untitled1 extends JFrame {

  private JLabel label = new JLabel();

  private JButton button = new JButton();



  public static void main(String[] args) {

    Untitled1 untitled = new Untitled1();

      untitled.init();

      untitled.setBounds(300,200,350,300);

      untitled.setVisible(true);

  }

  private void init(){

    label.setEnabled(false);

    label.setFont(new java.awt.Font("Dialog", 1, 30));

    label.setForeground(SystemColor.activeCaption);

    label.setToolTipText("");

    label.setText("u0644u0627 u0625u0644u0647 u0625u0644u0627 u0627u0644u0644u0647");

    label.setBounds(new Rectangle(68, 99, 229, 72));

    this.getContentPane().setLayout(null);

    button.setBounds(new Rectangle(80, 199, 191, 42));

    button.setFont(new java.awt.Font("Dialog", 1, 16));

    button.setForeground(Color.blue);

    button.setBorder(BorderFactory.createRaisedBevelBorder());

    button.setText("u0644u0627 u0625u0644u0647 u0625u0644u0627 u0627u0644u0644u0647");

    button.addActionListener(new java.awt.event.ActionListener() {

      public void actionPerformed(ActionEvent e) {

        button_actionPerformed(e);

      }

    });

    this.getContentPane().add(label, null);

    this.getContentPane().add(button, null);

  }

  void button_actionPerformed(ActionEvent e) {

  label.setEnabled(true);

  }

}

remember the numbers is the unicode for arabic letters

#9

and here is another code to drow a triangel

import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Polygon;

public class TriangleTest extends Applet {

   // create references to two triangles:
   private Triangle triangle1, triangle2;

   public void init() {

      // instantiate an isosceles triangle:
      triangle1 = new Triangle( 50, 25, 75, 100, 25, 100 );
      // instantiate a right triangle:
      triangle2 = new Triangle( 125, 25, 175, 100, 125, 100 );

   }

   public void paint( Graphics g ) {

      // draw the first triangle:
      triangle1.draw( g );

      // fill the second triangle:
      triangle2.fill( g );

   }

}

// A triangle is a polygon with three sides:
class Triangle extends Polygon {

   // Triangle constructor #1:
   public Triangle() {
      // invoke the constructor of the superclass Polygon:
      super();
   }

   // Triangle constructor #2:
   public Triangle( int x1, int y1, 
                    int x2, int y2, 
                    int x3, int y3  ) {

      // invoke the constructor of the superclass Polygon:
      super();

      // the 'this' reference is optional:
      this.addPoint( x1, y1 );
      this.addPoint( x2, y2 );
      this.addPoint( x3, y3 );

   }

   // Instance methods:
   public void draw( Graphics g ) {
      g.drawPolygon( this );
   }
   public void fill( Graphics g ) {
      g.fillPolygon( this );
   }

}

هذا الموضوع مغلق.

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