Elite Coders Society
Hello Guest!
Join us here in this forum!
Please Log in or Register to access more feature in this site.
Start Learning!

† Copyright ©️ 2011 - EliteCoders.forums.ag †
Elite Coders Society
Hello Guest!
Join us here in this forum!
Please Log in or Register to access more feature in this site.
Start Learning!

† Copyright ©️ 2011 - EliteCoders.forums.ag †


Start sharing and learning new skills about programming and design by building connections with other professional and students.
 
HomeForumBasic Window(OOP) 2a512xyPortalLatest imagesGalleryBasic Window(OOP) Dw6hztSearchBasic Window(OOP) 2ns506pBasic Window(OOP) 2dt2b75RegisterLog in
Elite Coders Partner Links

EliteCoders™️ News!
Hello Guest!, Welcome in our forum. Be active!

Share | 
 

 Basic Window(OOP)

View previous topic View next topic Go down 
AuthorMessage
Admin[dElmARk]
Admin[dElmARk]
Forum Owner
Forum Owner

Posts : 78
EC-Points : 6304
Thanked : 21
Join date : 15/10/2011
Age : 29
Location : Philippines

Hacker's Info
Hacking Exp:
Basic Window(OOP) Left_bar_bleue0/0Basic Window(OOP) Empty_bar_bleue  (0/0)
Hacker Type: White Hat
Hacking Title:

Basic Window(OOP) Empty
PostSubject: Basic Window(OOP)   Basic Window(OOP) EmptyFri Dec 02, 2011 8:49 am

Creating Window-Based Java

Code:
import javax.swing.*;
import java.awt.*;
import java.util.*;
class act{
    public static void main(String [] args){
Scanner xet = new Scanner(System.in);


    System.out.print("Title: ");
    String title = xet.nextLine();
    System.out.print("Name: ");
    String name = xet.nextLine();   
    System.out.print("Course: ");
    String course = xet.nextLine();   
    System.out.print("Food: ");
    String food = xet.nextLine();   
    System.out.print("Place: ");
    String place = xet.nextLine();
   


    System.out.print("X Pos: ");
    int x = xet.nextInt();   
    System.out.print("Y Pos: ");
    int y = xet.nextInt(); 
    System.out.print("Width: ");
    int w = xet.nextInt();
    System.out.print("Hight: ");
    int h = xet.nextInt();
   

   
   
JFrame myFrame = new JFrame(title);
 myFrame.setBounds(x,y,h,w);
 myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 myFrame.setVisible(true);
 JButton BTitle = new JButton(title);
 JButton BName = new JButton(name);
 JButton BFood = new JButton(food);
 JButton BPlace = new JButton(place);
 JButton BCourse = new JButton(course);
 
 JPanel myP = new JPanel(new BorderLayout());
  myP.add(BTitle, BorderLayout.CENTER);
  myP.add(BName, BorderLayout.NORTH);
  myP.add(BFood, BorderLayout.WEST);
  myP.add(BPlace, BorderLayout.EAST);
  myP.add(BCourse, BorderLayout.SOUTH); 
  myFrame.add(myP);
   
   
    }
}
Back to top Go down
 

Basic Window(OOP)

View previous topic View next topic Back to top 

 Similar topics

-
» Java Basic Syntax (E-Book)
» Java Basic Syntax (E-Book)
» Request for Visual Basic 2010 Portable
» Request for Visual Basic 2010 Portable
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Elite Coders Society :: Software Development :: Java Programming :: Object-Oriented Programming (OOP) Java-

Protected by Copyscape Duplicate Content Finder
Powered By EliteCoders™

Elite Coders Partner Links
GreyPhantomYour Link HereYour Link HereYour Link Here
Yahoo!GoogleFacebookForumotion