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

رسم السهم بالجافا

بدأه نجمة7 في 7 أغسطس 2009 · 3 رد · 542 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه ،،

كيف حالك إن شاء الله دائمــاً بخير ؟

أود سؤالكم كيف أرسم السهم ـــــــــــــــــــــــــــــــــــــــــــــــــــ>ـ

ب java

تحياتي وودي

#2

السلام عليكــم ورحمـة الله وبركاتــه ،،

معقووووووووووووووووووووول ولا واحد

:cry: :ohmy: :cry:

#3

هذا كود يوضح إحدى الطرق لرسم المتجهات

import java.awt.Graphics;
public class VectorShape extends javax.swing.JFrame {

	public VectorShape() {
		initComponents();
	}
	public void paint(Graphics g){
		super.paint(g);
		int x1 = 50;
		int y1 = 150;
		int x2 = 300;
		int y2 = 150;
		// this to draw the horezintal Line __________________________
		g.drawLine(x1, y1, x2, y2);

		// this to draw the up part of the arrow ( \ )
		g.drawLine(x2 - 10, y2 - 5, x2, y2);

		// this to draw the up part of the arrow ( / )
		g.drawLine(x2 - 10, y2 + 5, x2, y2);
	}

	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGap(0, 400, Short.MAX_VALUE)
		);
		layout.setVerticalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGap(0, 300, Short.MAX_VALUE)
		);

		pack();
	}// </editor-fold>

	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new VectorShape().setVisible(true);
			}
		});
	}
	// Variables declaration - do not modify
	// End of variables declaration

}
#4

أختي يجب أن تضعي محاولاتك حتى نساعدك

تحياتي

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png

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