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
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
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Java Forums

Share your Java programming ideas here.
 
HomeLatest imagesSearchRegisterLog 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.

 

 How to make a simple window.

Go down 
AuthorMessage
Rozza
Senior Member
Senior Member



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

How to make a simple window. Empty
PostSubject: How to make a simple window.   How to make a simple window. Icon_minitimeMon 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
 
How to make a simple window.
Back to top 
Page 1 of 1

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