Java Forums
Our Goal is to achieve and build a community. Even if there is nobody on the forum, please register. If we have a small community, people will see we have at least people and they will register. Any people please register!

Cheers,
Slick Java (Owner + Admin)
Java Forums

Share your Java programming ideas here.
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in
Our Goal is to achieve and build a community. Even if there is nobody on the forum, please register. If we have a small community, people will see we have at least people and they will register. Any people please register! Cheers, Slick Java (Owner + Admin)
We are also looking for moderators and admins.

Share | 
 

 How to make a simple window.

View previous topic View next topic Go down 
AuthorMessage
Rozza
Senior Member
Senior Member


Posts : 2
Points : 2740
Join date : 2013-07-01

PostSubject: How to make a simple window.   Mon Jul 01, 2013 6:45 pm

Heya...
I just wanted to help some new people by showing you how to simply make a window.
Here we go.
  !
  !
  !
  !
 \/

import javax.swing.*; // The import




public class Training {  //Your class
public static void main(String[] args){  //Main Method

new Training();
}
public Training(){
JFrame f = new JFrame();
f.setTitle("THE TITLE"); // This sets the title for your window.
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Exit one close, closes the window when you press the X.
f.setSize(700, 500); // This sets the size of the window.
f.setVisible(true); //Makes the window visible.
f.setLocationRelativeTo(null); // Makes the window appear in the middle.
}

}
Back to top Go down
View user profile
 
How to make a simple window.
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» How to recognize the pop up window during running script
» select window is only useful for popup or another tab (browser) also?
» How to make migraine patients happy!
» Ten Ways to Make Peace With the Past and Create a New Future
» How do I make the login popup show an Image, instead of it's bland colors

Permissions in this forum:You cannot reply to topics in this forum
Java Forums :: New to Java :: Ideas-
Jump to: