Yeni Cevap 
 
Konuyu Değerlendir
  • 1 Oy - 2 Ortalama
  • 1
  • 2
  • 3
  • 4
  • 5
Javada Frame Label kullanımı ve resim görüntüleme
15-12-2011, 01:48 (En son düzenleme: 15-12-2011 01:49 dede.)
Mesaj: #1
Javada Frame Label kullanımı ve resim görüntüleme
main
import javax.swing.JFrame;

  public class main
  {
     public static void main( String args[] )
     {
        LabelFrame labelFrame = new LabelFrame(); // create LabelFrame
        labelFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        labelFrame.setSize( 275, 180 ); // set frame size
        labelFrame.setVisible( true ); // display frame
     } // end main
  } // end class LabelTest
LabelFrame
import java.awt.FlowLayout; // specifies how components are arranged
  import javax.swing.JFrame; // provides basic window features
   import javax.swing.JLabel; // displays text and images
   import javax.swing.SwingConstants; // common constants used with Swing
   import javax.swing.Icon; // interface used to manipulate images
   import javax.swing.ImageIcon; // loads images

  public class LabelFrame extends JFrame
  {
     private JLabel label1; // JLabel with just text
     private JLabel label2; // JLabel constructed with text and icon
     private JLabel label3; // JLabel with added text and icon

     // LabelFrame constructor adds JLabels to JFrame
     public LabelFrame()
     {
        super( "Label" );
        setLayout( new FlowLayout() ); // set frame layout

        // JLabel constructor with a string argument
        label1 = new JLabel( "Label with text" );
        add( label1 ); // add label1 to JFrame

        // JLabel constructor with string, Icon and alignment arguments
        Icon bug = new ImageIcon( "images.jpeg"  );
        label2 = new JLabel( "Label with text and icon", bug,
           SwingConstants.LEFT );
        label2.setToolTipText( "This is label2" );
        add( label2 ); // add label2 to JFrame

        label3 = new JLabel(); // JLabel constructor no arguments
        label3.setText( "Label with icon and text at bottom" );
        label3.setIcon( bug ); // add icon to JLabel
        label3.setHorizontalTextPosition( SwingConstants.CENTER );
        label3.setVerticalTextPosition( SwingConstants.BOTTOM );
        add( label3 );
     }
  }

Çıktı eklentide


Eklenti Dosyaları Tırnak(lar)
   

Idea Sorunuz veya öneriniz varsa lütfen bildirin.
Bu kullanıcının gönderdiği tüm mesajları bul
Bu mesaji bir cevapta alıntı yap
Yeni Cevap 


Benzer Konular...
Konu: Yazar Cevaplar: Gösterim: Son Mesaj
  Javada Frame listbox dede 0 57 15-12-2011 02:03
Son Mesaj: dede
  Javada Frame checkbox dede 0 71 15-12-2011 01:59
Son Mesaj: dede
  Javada Frame Buton koyma ve action hale getirme dede 0 86 15-12-2011 01:54
Son Mesaj: dede

Foruma Git:


Bu konuyu görüntüleyen kullanıcı(lar): 1 Ziyaretçi

BilisimTurk.Org
İletişim | BilisimTurk | En Üste Dön | İçeriğe Dön | Arşiv | RSS Beslemesi