Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Sunday, July 2, 2017

Day 3 Java Training

Day 3 Java Training


//Creating Frames SampleFrame.java

import javax.swing.JFrame;

class sampleFrame{
public static void main(String[] args){
JFrame frame= new JFrame("MyFrame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,200);
frame.show();
}
}

// Creating Forms with Textfield

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class SampleForm extends JFrame{
JPanel panel;
JTextField txt;
SampleForm(){
super("My First Form");
panel=new JPanel();
txt=new JTextField("Hello",10);
panel=new JPanel();
panel.add(txt);
setContentPane(panel);
setSize(200,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
show();
}
public static void main(String[] args){
new SampleForm();}
}


//GUI array

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;
import java.awt.Dimension;
import java.awt.*;

public class SampleTable extends JFrame{
JPanel panel;
JTable table;
SampleTable(){
super("Table Form");
String[] title={"Name","Address","Age"};
Object[][] cnt={{"Julius","Antipolo","23"},{"Sheryl","Marikina","30"},{"May","Montalban","29"}};
panel=new JPanel();
table = new JTable(cnt,title);
table.setPreferredScrollableViewportSize(new Dimension (500,70));
table.setFillsViewportHeight(true);
panel.add(table);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(300,300);
setContentPane(panel);
show();

}
public static void main(String[] arg)
{
new SampleTable();
}
}
Read more »

Wednesday, April 19, 2017

Day 2 Java Training

Day 2 Java Training


//INHERITANCE

//Classroom.java

class Classroom{
String name;
int size;
int noOfChairs;

void display(){
System.out.println("Name:"+ name);
System.out.println("Size:"+ size);
System.out.println("No. of Chairs:"+ noOfChairs);
}
}

//TestClassroom.java

class TestClassroom{
public static void main(String[] args){
ComputerLab lab1 = new ComputerLab();
lab1.name="ICT Lab";
lab1.size=40;
lab1.noOfChairs=20;
lab1.noOfComputers=14;
lab1.display();
lab1.displayComputers();
}
}

//ComputerLab.java

class ComputerLab extends Classroom{
int noOfComputers;

void displayComputers(){
System.out.println("Computer:" + noOfComputers);}
}
______________________________________________________
//INHERITANCE
//Classroom.java

class Classroom{
String name;
int size;
int noOfChairs;

void display(){
System.out.println("Name:"+ name);
System.out.println("Size:"+ size);
System.out.println("No. of Chairs:"+ noOfChairs);
}
void setName(String n){
name=n;
}

void setSize(int s){
size=s;
}

void setChairs(int c){
noOfChairs=c;
}
}

// TestClassroom.java

class TestClassroom{
public static void main(String[] args){
ComputerLab lab1 = new ComputerLab();
lab1.setName("ICT Lab");
lab1.setSize(40);
lab1.setChairs(20);
lab1.setComputers(14);
lab1.display();
//lab1.displayComputers();
}
}

//ComputerLab.java

class ComputerLab extends Classroom{
int noOfComputers;

void displayComputers(){
System.out.println("Computer:" + noOfComputers);}

void setComputers(int comp){
noOfComputers=comp;
}

}
______________________________________________________

// Constructor

class Classroom1{
String name;
int size;
int noOfChairs;

Classroom1(String classN, int classSize, int classChair){
name=classN;
size=classSize;
noOfChairs=classChair;
}

void display(){
System.out.println("Name:"+ name);
System.out.println("Size:"+ size);
System.out.println("No. of Chairs:"+ noOfChairs);
}
public static void main(String[] args)
{
Classroom1 room2 = new Classroom1("St. Ignacius", 20,10);
room2.display();

}
}
_______________________________________________________________

// Computer Lab 1.java

class ComputerLab1 extends Classroom1{
int noOfComputers;

ComputerLab1(String a, int b, int c, int d){
super(a,b,c);
noOfComputers=d;
}

void displayComputers(){
System.out.println("Computer:" + noOfComputers);}

void setComputers(int comp){
noOfComputers=comp;
}
}

//TestClassroom.java

class TestClassroom2{
public static void main(String[] args){
ComputerLab1 lab2= new ComputerLab1("Maharlika", 20, 20, 40);
lab2.display();
lab2.displayComputers();
}
}
______________________________________________________________
// Overriding

//a.java
class a{
int a;
int b;
public void printTest(){
System.out.println("This is a " + a);
System.out.println("This is b " + b);
}
}

//b.java

class b extends a{
int c;
public void printTest(){
super.printTest();
System.out.println("This is c:" +c);
}
public static void main(String[] arg){
b myObj=new b();
myObj.a=1;
myObj.b=2;
myObj.c=3;
myObj.printTest();
}
}

_____________________________________________________
//bicycles.java

class bicycles
{
int gear;
int cadense;
int speed;
bicycles(int a, int b, int c){
gear=a;
cadense=b;
speed=c;
}
void printTest(){
System.out.println("This is a gear status:" + gear);
System.out.println("This is a cadense status:" + cadense);
System.out.println("This is a speed status:" + speed);
}
}

// bicycles1.java
class bicycles1 extends bicycles{
int height;
bicycles1(int a, int b, int c, int d){
super(a,b,c);
height=d;
}
void printTest(){
super.printTest();
System.out.println("This is a height: " + height);
}
}

// Testbicycle.java
class TestBicycle{
public static void main(String[] args)
{
bicycles1 myObj=new bicycles1(2,3,5,65);
myObj.printTest();
}
}
________________________________________________
Read more »

Sunday, April 2, 2017

Day 1 Java Training

Day 1 Java Training


//Creating "Hello World" in an Object Oriented Manner

public class MessageDisplay {
String message;
void display()
{
System.out.println(message);
}
public static void main(String Arg[]){
MessageDisplay mg = new MessageDisplay();
mg.message="Hello World";
mg.display();
}
}
_______________________________________________________
// Using Classes

class ByeWorld{
public static void main(String[] arg){
MessageDisplay bw=new MessageDisplay();
bw.message="Bye World!";
bw.display();
}
}
_______________________________________________________
//
public class MessageDisplay {
String message;
void display()
{
System.out.println(message);
}
void setMessage(String s){
message=s;
}
public static void main(String Arg[]){
MessageDisplay mg = new MessageDisplay();
mg.setMessage("Hello World!");
mg.display();
}
}
________________________________________________________
class temperature {
int temp;
boolean iswitch=true;
void checkTemp(int t){
temp=t;
if(temp>=100){
iswitch=false;}
else{
iswitch=true;
}
}
void displaystatus(){
String switchstatus;
if(iswitch)
{
switchstatus="ON";}
else{
switchstatus="OFF";
}
System.out.println("The temperature is: " + temp);
System.out.println("Device Status is: " + switchstatus);
}
}

class TestHeater{
public static void main(String[] arg){
temperature device1 = new temperature();
device1.checkTemp(100);
device1.displaystatus();
temperature device2 = new temperature();
device2.checkTemp(50);
device2.displaystatus();
}
}
Read more »

Sunday, April 5, 2015

Real Football Manager Edition Java Games Download For Mobile

Take your team in Real football manager edition to the victory. Choose a club among different leagues and teams. Make a training plan and an exclusive game tactics which will take you to the victory.To download Real football manager edition free java game, we recommend you to select your phone model, and then our system will choose the most suitable game files. Downloading is very simple: select the desired file and click "Java Real football manager edition - free download...!

Game features:



  • Many leagues and teams
  • Excellent graphics
  • Interesting playing process

 Real Football Manager Edition Java Games Screen Shot:

Real football manager edition


To download Real football manager edition free java game, we recommend you to select your phone model, and then our system will choose the most suitable game files. Downloading is very simple: select the desired file and click "Java Real football manager edition - free download", then select one of the ways you want to get the file. Just a few easy steps and will enjoy playing new game at your phone!
                                                                       




                                                               Click Here Download Now

                                                                                             
http://adf.ly/sLttY
 
Read more »

Saturday, April 4, 2015

Who Wants To Be A Millionaire 2011 Games Download For Java Mobile

Who Wants To Be A Millionaire 2011 In everything remained the same as in the previous versions of the game,however, the following changes were made: A color scheme of the game is completely new.Who Wants To Be A Millionaire 2011 All regular blue colors have been replaced by various shades of purple with some orange details.Who Wants To Be A Millionaire 2011  In "Millionaire 2010" there were problems with sound effects fro some phones. This time the problem has been corrected. a thousand of the new questions.



To download Who Wants To Be A Millionaire 2011 free java game, we recommend you to select your phone model, and then our system will choose the most suitable game files...!


Who Wants To Be A Millionaire 2011 Games Screen Shot:

Who Wants To Be A Millionaire 2011


To download Who Wants To Be A Millionaire 2011 free java game, we recommend you to select your phone model, and then our system will choose the most suitable game files. Downloading is very simple: select the desired file and click "Java Who Wants To Be A Millionaire 2011 - free download", then select one of the ways you want to get the file. Just a few easy steps and will enjoy playing new game at your phone!
                                                                                     
                                                            Click Here To Link Download Now
                                                                                                                      
http://adf.ly/xEikS





Read more »