Skip to content

Instantly share code, notes, and snippets.

View behitek's full-sized avatar
😎

Hieu Nguyen Van behitek

😎
View GitHub Profile
@behitek
behitek / Real_Time.java
Created December 15, 2016 12:20
Real Time In swing to a label
public class PlaySchoolClock {
public static void main(String[] args) {
new PlaySchoolClock();
}
public PlaySchoolClock() {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
@behitek
behitek / ReadWrite_jtableVsExcel.MD
Last active December 15, 2016 16:32
Read Write jTable - Excel in java swing using POI

Xuất jTable sang file Excel

Hàm thực thi đọc dữ liệu từ jTable vào file Excel

public static void toExcel(JTable table, File file) throws IOException {
        String sheetName = "Sheet1";//name of sheet
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet(sheetName);
        TableModel model = table.getModel();
        //Get colum name
 HSSFRow row = sheet.createRow(0);
@behitek
behitek / ME.MD
Last active December 24, 2016 10:32

Cập nhật số lượng sách khi thay đổi trên tb_CTPN

1

ALTER TRIGGER [dbo].[tg_DeleteCTPN]
   ON  [dbo].[tb_CTPN]
   For delete
AS 
BEGIN
	Declare @soLuong int
@behitek
behitek / Caro.java
Last active June 6, 2023 02:53
Game Caro Code Java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
@behitek
behitek / TEST.md
Last active January 4, 2017 16:22
Hiếu Nguyễn
@behitek
behitek / ReadWriteExcelFile.java
Last active October 30, 2018 05:05 — forked from madan712/ReadWriteExcelFile.java
Đọc ghi file Excel trong Java sử dụng Apache POI
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@behitek
behitek / QUACAN.java
Created February 21, 2017 01:40
Quả Cân – LASCALE
package com.vtcc.antispam.hieunv.quacan;
import java.util.Scanner;
import java.util.Vector;
/**
* Created by HieuNguyen on 02/20/2017.
*/
public class Main {
public static void main(String[] args) {
@behitek
behitek / Latgach.java
Created February 22, 2017 00:24
LÁT GẠCH 2
package com.vtcc.antispam.hieunv.latgach;
import java.util.Arrays;
import java.util.Scanner;
/**
* Created by HieuNguyen on 02/21/2017.
*/
public class Main {
static int n, x, y, a[][], cnt;
@behitek
behitek / latgach2.cpp
Created February 26, 2017 01:57
Lát gạch 2
package com.vtcc.antispam.hieunv.latgach;
import java.util.Scanner;
/**
* Created by HieuNguyen on 02/26/2017.
*/
public class Runner {
static int s, x, y, a[][], val = 0;
@behitek
behitek / ClientSide.java
Created February 27, 2017 13:47
Java Client Server Demo using Socket
package com.hieunv.ltht;
import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Scanner;
import static java.net.InetAddress.getByName;