import java.awt. *;
import java.awt.event. *;
import java.applet.Applet;
public class EventSample extends Applet implements ActionListener{
Button b1;
TextField txt1;
int counter=0;
public EventSample(){
b1 = new Button("Count");
txt1=new TextField(" ", 20);
add(b1);
b1.addActionListener(this);
add(txt1);
}
public void init(String[]args){
EventSample go=new EventSample();
}
public void actionPerformed(ActionEvent e){
++counter;
txt1.setText(counter+" ");
}
}
March 31, 2015
March 30, 2015
Visual Studio Activity2
Imports System.Data.SqlClient
Public Class Form1
Dim con As SqlConnection = New SqlConnection("Data Source=.\sqlexpress;Initial Catalog=Mynewdatabase;Integrated Security=True;Pooling=False")
Dim cmd As SqlCommand
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
Dim da As SqlDataAdapter
cmd = New SqlCommand("Select Customer_ID, P_roduct_name, Order_ID, Quantity from OrderTable where Customer_ID=('" & TextBox1.Text & "')", con)
con.Open()
da = New SqlDataAdapter(cmd)
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
con.Close()
End Sub
End Class
Public Class Form1
Dim con As SqlConnection = New SqlConnection("Data Source=.\sqlexpress;Initial Catalog=Mynewdatabase;Integrated Security=True;Pooling=False")
Dim cmd As SqlCommand
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
Dim da As SqlDataAdapter
cmd = New SqlCommand("Select Customer_ID, P_roduct_name, Order_ID, Quantity from OrderTable where Customer_ID=('" & TextBox1.Text & "')", con)
con.Open()
da = New SqlDataAdapter(cmd)
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
con.Close()
End Sub
End Class
March 29, 2015
Button(APPLET) NetBeans
import java.applet.Applet;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public abstract class Finalact extends Applet implements ItemListener{
Button Left=null;
Button Center=null;
Button Right=null;
@Override
public void init(){
Left=new Button("Left");
Center=new Button("Center");
Right=new Button("Right");
add(Left);
add(Center);
add(Right);
}
@Override
public void paint(Graphics b) {
b.drawString("AMA VISIION",140,150);
b.drawString("To be the leader and dominant provider ",140,150);
b.drawString("of relevant and globally recognized information ",140,150);
b.drawString("technology based education and ",140,150);
b.drawString("related services in the global market. ",140,150);
}
public void itemStatementChange(ItemEvent o){
repaint();
}
}
import java.applet.Applet;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public abstract class Finalact extends Applet implements ItemListener{
Button Left=null;
Button Center=null;
Button Right=null;
public void init(){
Button button1 = new Button();
Button button2 = new Button();
Button button3 = new Button();
button1.setForeground(Center);
button2.setLabel("My Button 1");
button3.setLabel("My Button 1");
}
public void paint(Graphics b) {
b.drawString("AMA VISIION",140,150);
b.drawString("To be the leader and dominant provider ",140,150);
b.drawString("of relevant and globally recognized information ",140,150);
b.drawString("technology based education and ",140,150);
b.drawString("related services in the global market. ",140,150);
}
public void itemStatementChange(ItemEvent o){
repaint();
}
}
http://www.java-examples.com/create-awt-button-example
http://www.java-examples.com/change-button-foreground-color-example
http://www.java-examples.com/create-awt-radio-buttons-using-checkboxgroup-example
import java.awt.Button;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public abstract class Finalact extends Applet implements ItemListener{
Button Left=null;
Button Center=null;
Button Right=null;
@Override
public void init(){
Left=new Button("Left");
Center=new Button("Center");
Right=new Button("Right");
add(Left);
add(Center);
add(Right);
}
@Override
public void paint(Graphics b) {
b.drawString("AMA VISIION",140,150);
b.drawString("To be the leader and dominant provider ",140,150);
b.drawString("of relevant and globally recognized information ",140,150);
b.drawString("technology based education and ",140,150);
b.drawString("related services in the global market. ",140,150);
}
public void itemStatementChange(ItemEvent o){
repaint();
}
}
import java.applet.Applet;
import java.awt.Button;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public abstract class Finalact extends Applet implements ItemListener{
Button Left=null;
Button Center=null;
Button Right=null;
public void init(){
Button button1 = new Button();
Button button2 = new Button();
Button button3 = new Button();
button1.setForeground(Center);
button2.setLabel("My Button 1");
button3.setLabel("My Button 1");
}
public void paint(Graphics b) {
b.drawString("AMA VISIION",140,150);
b.drawString("To be the leader and dominant provider ",140,150);
b.drawString("of relevant and globally recognized information ",140,150);
b.drawString("technology based education and ",140,150);
b.drawString("related services in the global market. ",140,150);
}
public void itemStatementChange(ItemEvent o){
repaint();
}
}
http://www.java-examples.com/create-awt-button-example
http://www.java-examples.com/change-button-foreground-color-example
http://www.java-examples.com/create-awt-radio-buttons-using-checkboxgroup-example
March 27, 2015
VIDEO Sample Program (HTML)2ndyear/tri-3rdsem
<html>
<body>
<div style = "text-align:center">
<button onclick="playPause()">Play/Pause</button>
<button onclick="makeBig()">Big</button>
<button onclick="makeSmall()">Small</button>
<button onclick="makeNormal()">Normal</button>
<br>
<video id="video1" width="420">
<source src ="sponge.mp4"type="video/mp4">
</video>
<script>
var myVideo=document.getElementById("video1");
function playPause()
{
if(myVideo.paused)
myVideo.play();
else
myVideo.spause();
}
function makeBig()
{
myVideo.width=760;
}
function makeSmall()
{
myVideo.width=520;
}
function makeNormal()
{
myVideo.width=620;
}
</script>
</body>
</html>
GUIDE:
* Use notepad.
* Save all file in One folder.
* Video must save as MP4.
* Save notepad as (filename.html)
note: If it wont work try to SAVE AS and name it a new name.
<body>
<div style = "text-align:center">
<button onclick="playPause()">Play/Pause</button>
<button onclick="makeBig()">Big</button>
<button onclick="makeSmall()">Small</button>
<button onclick="makeNormal()">Normal</button>
<br>
<video id="video1" width="420">
<source src ="sponge.mp4"type="video/mp4">
</video>
<script>
var myVideo=document.getElementById("video1");
function playPause()
{
if(myVideo.paused)
myVideo.play();
else
myVideo.spause();
}
function makeBig()
{
myVideo.width=760;
}
function makeSmall()
{
myVideo.width=520;
}
function makeNormal()
{
myVideo.width=620;
}
</script>
</body>
</html>
GUIDE:
* Use notepad.
* Save all file in One folder.
* Video must save as MP4.
* Save notepad as (filename.html)
note: If it wont work try to SAVE AS and name it a new name.
March 13, 2015
HTML (My personal Site)2ndyear/Tri-3rdsem
FIRST NOTEPAD
<html>
<head>
<title>My Personal Site</title>
</head>
<CENTER>
<h1>My Personal Site</h1>
</CENTER>
<CENTER>
<br>
<a href="Contents.html"><img src="n3.jpg" width="223" height="226"></a><br>
<br>
<br>
<br>
<b>CLICK PICTURE TO GO TO INDEX</b>
<CENTER>
</html>
ANOTHER NOTEPAD
SECOND NOTE PAD
<head>
<title>Contents</title>
<CENTER>
<h1>Contents</h1>
</CENTER>
<CENTER>
<br>
<br>
<br>
<ul>
<li><a href ="fov.pic.html">FAVORITE PICTURE</a></li><br><br>
<li><a href ="my favorite site.html">FAVORITE SITE</a></li><br><br>
<li><a href ="about.html">ABOUT ME</a></li><br><br>
<li><a href ="my personal site.html">EXIT</a></li><br><br>
</ul>
</head>
</html>
ANOTHER NOTEPAD
3RD NOTE PAD
<html>
<head>
<title>MY FAVORITE PICTURE</title>
</head>
<CENTER>
<h1>MY FAVORITE PICTURE</h1>
</CENTER>
<CENTER>
<br>
<br>
<center><img src="n8.jpg" width="287" height="177"></center>
<br>
<br>
<br>
<a href ="Contents.html">BACK TO CONTENTS</a><br><br>
</CENTER>
</html>
3RD NOTE PAD
<html>
<head>
<title>MY FAVORITE PICTURE</title>
</head>
<CENTER>
<h1>MY FAVORITE PICTURE</h1>
</CENTER>
<CENTER>
<br>
<br>
<center><img src="n8.jpg" width="287" height="177"></center>
<br>
<br>
<br>
<a href ="Contents.html">BACK TO CONTENTS</a><br><br>
</CENTER>
</html>
ANOTHER NOTEPAD
4TH NOTE PAD
4TH NOTE PAD
<html>
<head>
<title>MY FAVORITE SITE</title>
</head>
<CENTER>
<br>
<ul>
<li><a href ="https://www.facebook.com/"><img src="n7.jpg" width="500" height="200"></a></li><br><br>
<li><a href ="https://www.google.com.ph/"><img src="n4.jpg" width="500" height="200"></a></li><br><br>
<li><a href ="http://tl.wikipedia.org/"><img src="n5.jpg" width="500" height="200"></a></li><br><br>
<li><a href ="https://ph.yahoo.com/"><img src="n6.jpg" width="500" height="200"></a></li><br><br>
</ul>
<br>
<br>
<br>
<br>
<a href ="Contents.html">BACK TO CONTENTS</a><br><br>
</CENTER>
</html>
ANOTHER NOTEPAD
5TH NOTE PAD
5TH NOTE PAD
<html>
<head>
<title>GENE LIZA CORDOVA</title>
</head>
<center><img src="n9.jpg" width="500" height="600"></center>
<CENTER>
<h1>GENE LIZA CORDOVA</h1>
</CENTER>
<CENTER>
<br>
AGE: 18 years old
<br>
BIRTHDAY: July 24, 1996
<br>
SCHOOL: AMACC
<br>
ADDRESS: Blk. 21 lot.6 Villa La Prinza Calamba Laguna
<br>
<br>
<br>
<br>
<a href ="Contents.html">BACK TO CONTENTS</a><br><br>
</CENTER>
</html>
(SAVE ALL AS .html)
(SAVE ALL AS .html)
March 5, 2015
TASM (CS332 Comp ORG, ARC and ASSM Language Program) 2ndyear/Tri-3rd sem
.model small
.stack 100h
.data
message db 'This is an assembly language program.', 0DH, 0AH, '$'
.code
main proc
mov ax, @data
mov ds, ax
mov ah, 9
mov dx, offset message
int 21h
.stack 100h
.data
message db 'This is an assembly language program.', 0DH, 0AH, '$'
.code
main proc
mov ax, @data
mov ds, ax
mov ah, 9
mov dx, offset message
int 21h
mov ax, 4C00h
int 21h
int 21h
main endp
end main
end main
March 4, 2015
DATABASE MANAGEMENT (SQL TUTORIAL)
http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all
>>> Run SQL:
Type this code:
SELECT Customers.CustomerID, Customers.CustomerName, Products.ProductName, Products.ProductID, Orders.OrderID From Customers, Products, Orders where Customers.CustomerID='58' and Orders.OrderID='10322' and Products.ProductID='77'
>>> Run SQL:
Type this code:
SELECT Customers.CustomerID, Customers.CustomerName, Products.ProductName, Products.ProductID, Orders.OrderID From Customers, Products, Orders where Customers.CustomerID='58' and Orders.OrderID='10322' and Products.ProductID='77'
DATABASE MANAGEMENT 2ndyear-3rd/TriSem(Creating a flower shop)
create database flowershop
use flowershop
create table Customer_Table
(CustomerID int, CustomerName nvarchar(50), Addresss nvarchar(50), Contact_Number int);
create table Flower_Table
(FlowersID int, FlowersName nvarchar(50), FlowersPriceperpcs int, CustomerID int, OrderID int);
create table Order_Table
(OrderID int, Pcs int, FlowersPriceperpcs int, CustomersID int, Cash int, creditcard int);
select * from Flower_Table
select * from Customer_Table
select * from Order_Table
/*Ascending And Descending*/
select * from Customer_Table order by CustomerName ASC
select * from Customer_Table order by CustomerName DESC
/*PUTTING A NICK NAME*/
Select Customer_Table.CustomerID AS CCID from Customer_Table
Select CT.CustomerID, CT.CustomerName, Pcs from Customer_Table AS CT, Order_Table as OT
where CT.CustomerID=OT.CustomersID
Attention:
/* This is a comment symbol */
use flowershop
create table Customer_Table
(CustomerID int, CustomerName nvarchar(50), Addresss nvarchar(50), Contact_Number int);
create table Flower_Table
(FlowersID int, FlowersName nvarchar(50), FlowersPriceperpcs int, CustomerID int, OrderID int);
create table Order_Table
(OrderID int, Pcs int, FlowersPriceperpcs int, CustomersID int, Cash int, creditcard int);
select * from Flower_Table
select * from Customer_Table
select * from Order_Table
/*Ascending And Descending*/
select * from Customer_Table order by CustomerName ASC
select * from Customer_Table order by CustomerName DESC
/*PUTTING A NICK NAME*/
Select Customer_Table.CustomerID AS CCID from Customer_Table
Select CT.CustomerID, CT.CustomerName, Pcs from Customer_Table AS CT, Order_Table as OT
where CT.CustomerID=OT.CustomersID
Attention:
/* This is a comment symbol */
February 19, 2015
ASSEMBLY PROGRAMMING | TASM (CS332-COMP ORG, ARC & ASSM LANG PROGRAM) 2ndyear/Tri-3rdsem
Assembly programming
assembly programs are generally written as pure text files using any text editor (Notepad etc.) as saved as. ASM files the steps are as follows.
1.CODES the program and save as .asm files, using any suitable text editor. dont use MS-Word or any word processing software.
2.ASSEMBLE program with the command Tasm <filenamw.ASM>. An object file <filename.obj> is generated.
3.If no errors are found, LINK the object file: TLINK <filename> to generate executable program/file <filename.e
REQUIREMENTS
1. Turbo Assemble (TASM.EXE)
2. LINKER (TLINK.EXE)
3.Editor
a. Notepad
b. C++ editor saved as a pure text file with asm extension.
Generally source file (.asm) is made up of segments containing INSTURCTION/MNEMOMICS and or DIRECTIVES. Comments must be proceded by a semi-colon (;) for each line.
Generally instructions are in the form of mnemomics such as:
*MOV
*ADD
*SUB
*RET
*INT
*XOR
*OR
*NOT
*MUL
*DIV
etc.
Arithmetic Instructions
* ADD
*MUL
*DIV
*SUB
Move Instructions
*MOV - Interrups
Logical Instructions
*OR
*AND
*NOT
*XOR
Other Instructions
*PUSH
*POP
*RET
*ROL
*ROR
Jump Instructions
*JMP-jump
*JE-jump if equal
*JNE-jump if not equal
*JZ-jump if zero
*JNZ-jump if not zero
*JAE-jump above/Equal
Sample program
PAGE SR, 132
TITLE DISPLAY
SSEG SEGMENT STRACK
DB 32 DUP ("STRACK....")
SSEG ENDS
DSEG SEGMENT
MESSAGE DB "HELLO, HOW ARE YOU?", OOH.OAH
L_MESS EQU $-MESSAGE
CSEG SEGMENT 'CODE'
ASSUME OS:CSEG:SS:SSEG,DS:DSEG
MAIN
PROC FAR
PUSH DS
PUSH O
MOV DX,DSEG
MOV DX,AX
MOV BX, 0001H
LEA DX,MESSAGE
MOV CX,L-MESS
MOV AH,40H
INT 21H
MAIN ENDP
CSEG ENDS
END MAIN
assembly programs are generally written as pure text files using any text editor (Notepad etc.) as saved as. ASM files the steps are as follows.
1.CODES the program and save as .asm files, using any suitable text editor. dont use MS-Word or any word processing software.
2.ASSEMBLE program with the command Tasm <filenamw.ASM>. An object file <filename.obj> is generated.
3.If no errors are found, LINK the object file: TLINK <filename> to generate executable program/file <filename.e
REQUIREMENTS
1. Turbo Assemble (TASM.EXE)
2. LINKER (TLINK.EXE)
3.Editor
a. Notepad
b. C++ editor saved as a pure text file with asm extension.
Generally source file (.asm) is made up of segments containing INSTURCTION/MNEMOMICS and or DIRECTIVES. Comments must be proceded by a semi-colon (;) for each line.
Generally instructions are in the form of mnemomics such as:
*MOV
*ADD
*SUB
*RET
*INT
*XOR
*OR
*NOT
*MUL
*DIV
etc.
Arithmetic Instructions
* ADD
*MUL
*DIV
*SUB
Move Instructions
*MOV - Interrups
Logical Instructions
*OR
*AND
*NOT
*XOR
Other Instructions
*PUSH
*POP
*RET
*ROL
*ROR
Jump Instructions
*JMP-jump
*JE-jump if equal
*JNE-jump if not equal
*JZ-jump if zero
*JNZ-jump if not zero
*JAE-jump above/Equal
Sample program
PAGE SR, 132
TITLE DISPLAY
SSEG SEGMENT STRACK
DB 32 DUP ("STRACK....")
SSEG ENDS
DSEG SEGMENT
MESSAGE DB "HELLO, HOW ARE YOU?", OOH.OAH
L_MESS EQU $-MESSAGE
CSEG SEGMENT 'CODE'
ASSUME OS:CSEG:SS:SSEG,DS:DSEG
MAIN
PROC FAR
PUSH DS
PUSH O
MOV DX,DSEG
MOV DX,AX
MOV BX, 0001H
LEA DX,MESSAGE
MOV CX,L-MESS
MOV AH,40H
INT 21H
MAIN ENDP
CSEG ENDS
END MAIN
February 8, 2015
CONTRUCTOR or ABSTRACT CLASS for WEIGHT
Wieght Constractor with Paramaters
CONSTRACTOR:
public class Weight1 {
double zkg;
double yg;
double akg;
double sg;
Weight1(double z, double y, double a, double s){
zkg=z;
yg=y;
akg=a;
sg=s;
}
MAIN CLASS:
import java.util.Scanner;
public class Weight {
public static void main (String[]args){
Weight1 r1=new Weight1(0.453592, 453.59237, 0.02834952, 28.34952);
Scanner wieghtconverter = new Scanner(System.in);
System.out.println("Coverter \n Select to convert? \n 1 Pound \n 2 Ounce");
double m1=wieghtconverter.nextInt();
if(m1==1){
System.out.println("Enter number in pounds: ");
double pounds=wieghtconverter.nextInt();
double poundskg=pounds*r1.zkg;
double poundsg=pounds*r1.yg;
System.out.println("Kilograms: "+poundskg);
System.out.println("grams: "+poundsg);
}
else{
System.out.println("Enter number in ounce.");
double ounce=wieghtconverter.nextInt();
double ouncekg=ounce*r1.akg;
double ounceg=ounce*r1.sg;
System.out.println("Kilograms: "+ouncekg);
System.out.println("grams: "+ounceg);
}
}
}
CONSTRACTOR:
public class Weight1 {
double zkg;
double yg;
double akg;
double sg;
Weight1(double z, double y, double a, double s){
zkg=z;
yg=y;
akg=a;
sg=s;
}
MAIN CLASS:
import java.util.Scanner;
public class Weight {
public static void main (String[]args){
Weight1 r1=new Weight1(0.453592, 453.59237, 0.02834952, 28.34952);
Scanner wieghtconverter = new Scanner(System.in);
System.out.println("Coverter \n Select to convert? \n 1 Pound \n 2 Ounce");
double m1=wieghtconverter.nextInt();
if(m1==1){
System.out.println("Enter number in pounds: ");
double pounds=wieghtconverter.nextInt();
double poundskg=pounds*r1.zkg;
double poundsg=pounds*r1.yg;
System.out.println("Kilograms: "+poundskg);
System.out.println("grams: "+poundsg);
}
else{
System.out.println("Enter number in ounce.");
double ounce=wieghtconverter.nextInt();
double ouncekg=ounce*r1.akg;
double ounceg=ounce*r1.sg;
System.out.println("Kilograms: "+ouncekg);
System.out.println("grams: "+ounceg);
}
}
}
Subscribe to:
Posts (Atom)