How to Create a Frame In Java By Swing Platform


Its very easy to create a frame by using Java swing platform in java runtime environment. In this last blog i discus about How to SetUp Java Environment In your PC . This blog i discus about How to Create a Frame In Java By Swing Platform.



    1. import javax.swing.*;  
    2. public class Simple2 extends JFrame{//To inheriting JFrame  
    3. JFrame f;  
    4. Simple2(){  
    5. JButton b=new JButton("click");//To create button  
    6. b.setBounds(130,100,10040);  
    7.           
    8. add(b);//T0 adding button on frame  
    9. setSize(400,500);  
    10. setLayout(null);  
    11. setVisible(true);  
    12. }  
    13. public static void main(String[] args) {  
    14. new Simple2();  
    15. }}  
How to Create a Frame In Java By Swing Platform How to Create a Frame In Java By Swing Platform Reviewed by Learn Programming on 12:02:00 PM Rating: 5

No comments:

Powered by Blogger.