Learning JAVA By Q & A:
===================
Q1. How do i create a simple Window in Java?
Q2. How do i write text in a Java Window? For Example, how do i write text 'Login' and 'Password' in a Window?
File Name : Frame.java
-----------------------------
Initial File Created using Eclipse Neon 3 Release (4.6.3); Eclipse JAVA EE IDE for Web Developers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
*
*
/**
* @author YourName
*
*/
public class Frame {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame myFrame = new JFrame();
myFrame.show();
myFrame.setSize(5000, 5000);
myFrame.setTitle("My First Frame!!!!!");
JOptionPane.showMessageDialog(null, "JAVA Tutorial : First Frame!!!!");
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
No comments:
Post a Comment