Java Hotel Management Program (Philippine)

*********************************************************************
COMPLETE SOURCE CODE FOR : TTKH.java
BY : Phi
*********************************************************************


/**
* @(#)TTKH.java
*
* TTKH application
*
* @author
* @version 1.00 2010/3/21
*/
import javax.swing.*;
import java.awt.*;

public class TTKH {

public static void main(String[] args) {
try {
// Set System L&F
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException e) {
// handle exception
}
catch (ClassNotFoundException e) {
// handle exception
}
catch (InstantiationException e) {
// handle exception
}
catch (IllegalAccessException e) {
// handle exception
}


//=----------------------------------------------------

// TODO, add your application code
JFrame frame = new JFrame();


JPanel panel = new JPanel();
JPanel khungchitiet = new JPanel();
//JPanel p1 = new JPanel();

//JPanel p2 = new JPanel();
//p2.setLayout(new FlowLayout());
JPanel khungtimkiem = new JPanel();
GridLayout g2 = new GridLayout(2,2);
khungtimkiem.setLayout(new GridLayout(5,2,10,10));
GridLayout g1 = new GridLayout(1,1);
khungchitiet.setLayout(new GridLayout(7,2,10,10));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// frame.setLocationByPlatform(true);

frame.setSize(680,470);


// Giao dien

JLabel ldemuc = new JLabel("Thong Tin Khach Hang");
ldemuc.setFont(new Font("Tahoma", Font.BOLD, 25));
ldemuc.setLayout(new FlowLayout());
panel.add(ldemuc);



// Khung Chi tiet
JLabel ltenKH = new JLabel("Ten KH");
JTextField ttenKH = new JTextField("Nguyen Van A",1);
JLabel lngaynhan = new JLabel("Ngay Nhan Phong");
JTextField tngaynhan = new JTextField("12/05/2009",1);
JLabel lngaysinh = new JLabel("Ngay Sinh");
JTextField tngaysinh = new JTextField("11/09/1986",1);
JLabel lngaytra = new JLabel("Ngay Tra Phong") ;
JTextField tngaytra = new JTextField("22/05/2009",1);
JLabel lgioitinh = new JLabel("Gioi Tinh");
JTextField tgioitinh = new JTextField("Nam",1);
JLabel lsodt = new JLabel("So Dien Thoai");
JTextField tsodt = new JTextField("0912345677",1);
JLabel lloaiphong = new JLabel("Loai Phong");
JTextField tloaiphong = new JTextField("Vip",1);
JLabel lcmnd = new JLabel("So CMND");
JTextField tcmnd = new JTextField("036365888",1);
JLabel lmaKH = new JLabel("Ma KH");
JTextField tmaKH = new JTextField("001",1);
JLabel lemail = new JLabel("Email");
JTextField temail = new JTextField("nguoidep@gmail.com",1);
JLabel lspace = new JLabel("--------------");
JLabel lspace1 = new JLabel(" ");
JLabel lspace2 = new JLabel("");
JLabel lspace3 = new JLabel("--------------");
JLabel lspace4 = new JLabel(" ");
JLabel lspace5 = new JLabel(" ");
JLabel lchitiet = new JLabel("Chi Tiet Khach Hang") ;
lchitiet.setFont(new Font("Tahoma", Font.BOLD, 15));
JLabel ltimkiem = new JLabel("Tim Kiem Nhanh") ;
ltimkiem.setFont(new Font("Tahoma", Font.BOLD, 15));



khungchitiet.add(lchitiet);
khungchitiet.add(lspace);
khungchitiet.add(lspace1);
khungchitiet.add(lspace2);
//khungchitiet.add(lspace3);
khungchitiet.add(lmaKH);
khungchitiet.add(tmaKH);
khungchitiet.add(lngaynhan);
khungchitiet.add(tngaynhan);
khungchitiet.add(ltenKH);
khungchitiet.add(ttenKH);
khungchitiet.add(lngaytra);
khungchitiet.add(tngaytra);
khungchitiet.add(lgioitinh);
khungchitiet.add(tgioitinh);
khungchitiet.add(lsodt);
khungchitiet.add(tsodt);
khungchitiet.add(lngaysinh);
khungchitiet.add(tngaysinh);
khungchitiet.add(lloaiphong);
khungchitiet.add(tloaiphong);
khungchitiet.add(lcmnd);
khungchitiet.add(tcmnd);
khungchitiet.add(lemail);
khungchitiet.add(temail);
khungchitiet.add(ltimkiem);
khungchitiet.add(lspace3);
khungchitiet.add(lspace4);
khungchitiet.add(lspace5);




// phan tim kiem

JLabel lmaKH2 = new JLabel("Ma KH");
lmaKH2.setForeground(Color.red);
JTextField tmaKH2 = new JTextField("Nhap ma khach hang...");
Choice c1 = new Choice();
c1.addItem("Vip");
c1.addItem("Phong Gia dinh");
c1.addItem("Phong Quat");
c1.addItem("Phong May lanh");
//JLabel lgioitinh2 = new JLabel("Gioi tinh");
//JRadioButton rnam = new JRadioButton("Nam",true);
//JRadioButton rnu = new JRadioButton("Nu",false);
JLabel lngaynhan2 = new JLabel("Ngay Nhan");
lngaynhan2.setForeground(Color.red);
JTextField tngaynhan2 = new JTextField("Nhap ngay nhan dd/mm/yyyy");
JLabel lcmnd2 = new JLabel("So CMND");
JTextField tcmnd2 = new JTextField("Nhap so");
JLabel lngaytra2 = new JLabel("Ngay Tra");
lngaytra2.setForeground(Color.red);
JTextField tngaytra2 = new JTextField("Nhap ngay tra dd/mm/yyyy");
JLabel ltenKH2 = new JLabel("Ten KH");
JTextField ttenKH2 = new JTextField("Nhap ten KH");
JLabel ls1 = new JLabel(" ");
JLabel ls2 = new JLabel(" ");
JLabel ls3 = new JLabel(" ");
JLabel ls4 = new JLabel(" ");
JLabel ls5 = new JLabel(" ");
JLabel ls6 = new JLabel(" ");
JButton b1 = new JButton("Lam Moi");
JButton b2 = new JButton("Tim");
JButton b3 = new JButton("Thoat");
//JLabel ls5 = new JLabel(" ");
JLabel loaiphong = new JLabel("Loai Phong");
khungtimkiem.add(lmaKH2);
khungtimkiem.add(tmaKH2);
khungtimkiem.add(lngaynhan2);
khungtimkiem.add(tngaynhan2);
khungtimkiem.add(ltenKH2);
khungtimkiem.add(ttenKH2);
khungtimkiem.add(lngaytra2);
khungtimkiem.add(tngaytra2);
khungtimkiem.add(lcmnd2);
khungtimkiem.add(tcmnd2);
khungtimkiem.add(ls1);
khungtimkiem.add(ls2);
khungtimkiem.add(loaiphong);
khungtimkiem.add(c1);
khungtimkiem.add(ls3);
khungtimkiem.add(b2);
khungtimkiem.add(ls5);
khungtimkiem.add(ls6);
khungtimkiem.add(b1);
khungtimkiem.add(b3);


frame.setLayout(new BorderLayout());
frame.add(panel, BorderLayout.NORTH);
//frame.add(p1, BorderLayout.LINE_START);
frame.add(khungchitiet, BorderLayout.WEST);
//frame.add(p2, BorderLayout.WEST);
//frame.add(p2, BorderLayout.LINE_END);
frame.add(khungtimkiem, BorderLayout.SOUTH);
frame.setVisible(true);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

Java radians to degree


*********************************************************************
COMPLETE SOURCE CODE FOR : RadiansToDegree.java
*********************************************************************


public class RadiansToDegree
{
public static void main(String[]args)
{
//radians value
double radians=1.5707963267948966;

//Get degree value for radians value equal to 1.5707963267948966
double degree=Math.toDegrees(radians);

System.out.println(degree);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

Java degree to radians


*********************************************************************
COMPLETE SOURCE CODE FOR : DegreeToRadians.java
*********************************************************************


public class DegreeToRadians
{
public static void main(String[]args)
{
//90 degree
double degree=90;

//Get radians value for 90 degree
double radians=Math.toRadians(degree);

System.out.println(radians);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

EzIcon


You can use this small tool to convert windows icon file (.ico) to 5 other images format like below

.tga
.bmp
.jpeg
.png
.psd

JAutorunKiller

You can use this small tool to remove autorun file(autorun.inf) that usually use by computer viruses to start their program from removable drive. This is not mean autorun file is a malicious file. Autorun file is always use in compact disc when disc creator want executable file in the compact disc execute when user click on cd drive icon.Click link below to download :
JAutorunKiller.jar

Free java decompiler

This is one of java decompiler that can be use to get java source file (file with .java as it's file extension) from any java class file (file with .class as it's file extension). Class file is a result after compiling process success without any syntax error.

Click link below to download

1. JD-GUI




2. Cavaj Java Decompiler


3. JCavaj Java Decompiler

Java get binary value from alphabet

Today, i have learned about how to get binary value from alphabet. You can try compile and execute java program below to get all binary value for A-Z and a-z.


*********************************************************************
COMPLETE SOURCE CODE FOR : JavaGetBinaryFromLetter.java
*********************************************************************


public class JavaGetBinaryFromLetter
{
public static void main(String[]args)
{
String a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

for(int i=0;i<a.length();i++)
{
char b=a.charAt(i);
int temp=(int)b;
String c=Integer.toBinaryString(temp);
System.out.println("BINARY VALUE FOR LETTER "+b+" IS : "+c);
}
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

RELAXING NATURE VIDEO