March 31, 2015

netbeans(EVENTSAMPLE)

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 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

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

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.

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


<html>
<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>



ANOTHER NOTEPAD
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


<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)

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
mov ax, 4C00h
int 21h
main endp
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'

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 */