Programlama | Programlama Dilleri | C Programlama Dili |C++

Hata
  • XML Parsing Error at 1:82. Error 9: Invalid character


Fonksiyonel Pencere Düzenleme

Netbeans platformunda yap?lan proje sayesinde kullan?c?dan al?nan say?n?n okunmas?n? sa?lamaktad?r. Dist klasorü içindeki "JavaApplication3.jar" uzant?l? dosya çal??t?r?larak sistem ba??ms?z program çal??t?r?labilir.

Program ile birlikte farkl? iki GridLayout düzeni pencereye aktar?l?r.

Program?n Tamam?n? A?a??daki Linkten ?ndirebilirsiniz

Linki Görebilmeniz ?çin Üye Olman?z Gerekmektedir...

Üye Kay?t

Program Kodu:

 
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

 
package javaapplication3;
 
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
 
/**
 *
 * @author Celal Atalar
 */

public class GridLayoutDuzen extends JFrame implements ActionListener{
 
    private JButton buttons[];
    private String names[]={"one","two","three","four","five","six"};
    private GridLayout grid1,grid2;  
    private boolean toggle=true;
    private Container pencere;
    public GridLayoutDuzen()
    {
     super("GridLayout Olay?");
     grid1=new GridLayout(2,3,5,5);
     grid2=new GridLayout(3,2);
     pencere=getContentPane();
     pencere.setLayout(grid1);
     buttons=new JButton[names.length];
     for(int count=0;count<names.length;count++)
     {
       buttons[count]=new JButton(names[count]);
       pencere.add(buttons[count]);
       buttons[count].addActionListener(this);
     }
    
    setSize(350,500);
    setVisible(true);
    }
   
    public void actionPerformed(ActionEvent event)
    {
       if(toggle==true)  
       pencere.setLayout(grid2);
       else
       pencere.setLayout(grid1);
       toggle=!toggle;
       pencere.validate();
 
    }
    /**
     * @param args the command line arguments
     */

    public static void main(String[] args)
    {
     GridLayoutDuzen application=new GridLayoutDuzen();
     application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
 
}
 
 
 

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Perşembe, 07 Nisan 2011 23:47 )  
404 Not Found

404

Not Found

The resource requested could not be found on this server!


Proudly powered by LiteSpeed Web Server

Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.