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

[مخالف - لم يستخدم البحث :]اريد شرح للبرنامج الاتى ضروري

مغلق
بدأه mando_java في 25 أغسطس 2009 · 1 رد · 401 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

الكود

1 // Fig. 11.6: LabelFrame.java

2 // Demonstrating the JLabel class.

3 import java.awt.FlowLayout; // specifies how components are arranged

4 import javax.swing.JFrame; // provides basic window features

5 import javax.swing.JLabel; // displays text and images

6 import javax.swing.SwingConstants; // common constants used with Swing

7 import javax.swing.Icon; // interface used to manipulate images

8 import javax.swing.ImageIcon; // loads images

9

10 public class LabelFrame extends JFrame

11 {

12 private JLabel label1; // JLabel with just text

13 private JLabel label2; // JLabel constructed with text and icon

14 private JLabel label3; // JLabel with added text and icon

15

16 // LabelFrame constructor adds JLabels to JFrame

17 public LabelFrame()

18 {

19 super( "Testing JLabel" );

20 setLayout( new FlowLayout() ); // set frame layout

21

22 // JLabel constructor with a string argument

23 label1 = new JLabel( "Label with text" );

24 label1.setToolTipText( "This is label1" );

25 add( label1 ); // add label1 to JFrame

26

27 // JLabel constructor with string, Icon and alignment arguments

28 Icon bug = new ImageIcon( getClass().getResource( "bug1.gif" ) );

29 label2 = new JLabel( "Label with text and icon", bug,

30 SwingConstants.LEFT );

31 label2.setToolTipText( "This is label2" );

32 add( label2 ); // add label2 to JFrame

33

34 label3 = new JLabel(); // JLabel constructor no arguments

35 label3.setText( "Label with icon and text at bottom" );

36 label3.setIcon( bug ); // add icon to JLabel

37 label3.setHorizontalTextPosition( SwingConstants.CENTER );

38 label3.setVerticalTextPosition( SwingConstants.BOTTOM );

39 label3.setToolTipText( "This is label3" );

40 add( label3 ); // add label3 to JFrame

41 } // end LabelFrame constructor

42 } // end class LabelFrame

1 // Fig. 11.6: LabelFrame.java

2 // Demonstrating the JLabel class.

3 import java.awt.FlowLayout; // specifies how components are arranged

4 import javax.swing.JFrame; // provides basic window features

5 import javax.swing.JLabel; // displays text and images

6 import javax.swing.SwingConstants; // common constants used with Swing

7 import javax.swing.Icon; // interface used to manipulate images

8 import javax.swing.ImageIcon; // loads images

9

10 public class LabelFrame extends JFrame

11 {

12 private JLabel label1; // JLabel with just text

13 private JLabel label2; // JLabel constructed with text and icon

14 private JLabel label3; // JLabel with added text and icon

15

16 // LabelFrame constructor adds JLabels to JFrame

17 public LabelFrame()

18 {

19 super( "Testing JLabel" );

20 setLayout( new FlowLayout() ); // set frame layout

21

22 // JLabel constructor with a string argument

23 label1 = new JLabel( "Label with text" );

24 label1.setToolTipText( "This is label1" );

25 add( label1 ); // add label1 to JFrame

26

27 // JLabel constructor with string, Icon and alignment arguments

28 Icon bug = new ImageIcon( getClass().getResource( "bug1.gif" ) );

29 label2 = new JLabel( "Label with text and icon", bug,

30 SwingConstants.LEFT );

31 label2.setToolTipText( "This is label2" );

32 add( label2 ); // add label2 to JFrame

33

34 label3 = new JLabel(); // JLabel constructor no arguments

35 label3.setText( "Label with icon and text at bottom" );

36 label3.setIcon( bug ); // add icon to JLabel

37 label3.setHorizontalTextPosition( SwingConstants.CENTER );

38 label3.setVerticalTextPosition( SwingConstants.BOTTOM );

39 label3.setToolTipText( "This is label3" );

40 add( label3 ); // add label3 to JFrame

41 } // end LabelFrame constructor

42 } // end class LabelFrame

#2

الأخ الكريم/الأخت الكريمة

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

مرحباً بكم في منتدى الفريق العربي للبرمجة

تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات، فقرة استخدام البحث قبل السؤال.

قواعد طرح المشاركات

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

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

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

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

728x90.png

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

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

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…