Skip to content

Instantly share code, notes, and snippets.

View seungdols's full-sized avatar
💭
💻 working.

seungdols seungdols

💭
💻 working.
View GitHub Profile
@seungdols
seungdols / getSelectionRowInJtable.java
Created November 26, 2015 12:29 — forked from choiseungho/getSelectionRowInJtable.java
get first cell of selected row in Jtable
/* tableView.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
prog_NM = tableView.getValueAt(tableView.getSelectedRow(), 0).toString();
System.out.println(prog_NM);
}
}
@seungdols
seungdols / CusDefaultTableModel.java
Created November 26, 2015 12:29 — forked from choiseungho/CusDefaultTableModel.java
Prevent changing data of cell in JTable
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
public class CusDefaultTableModel extends DefaultTableModel {
@Override
public boolean isCellEditable(int row, int column) {
@seungdols
seungdols / PreventTwiceSelectionFromTable.java
Created November 26, 2015 12:30 — forked from choiseungho/PreventTwiceSelectionFromTable.java
Prevent Calling Twice ValueChanged Method From Table
tableView.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()){
System.out.println(tableView.getValueAt(tableView.getSelectedRow(), 0).toString());
}
}
@seungdols
seungdols / SwingTableView.java
Created November 26, 2015 12:30 — forked from choiseungho/SwingTableView.java
Swing의 Table View 간단 예제
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JList;
@seungdols
seungdols / GenericsErasure.java
Created November 26, 2015 12:30 — forked from choiseungho/GenericsErasure.java
java의 generics Erasure 한계를 보여주는 코드
package com.tistory.seungdols;
import java.util.ArrayList;
import java.util.List;
/**
* @PROJECT bytecodeTest
* @PACKAGE com.tistory.seungdols
* @WRITTER Administrator
* @DATE 2015-11-05
@seungdols
seungdols / Eratos.java
Created November 26, 2015 12:30 — forked from choiseungho/Eratos.java
에라토스테네스의 체 알고리즘으로 소수 구하기
package com.tistory.seungdols;
import java.util.ArrayList;
import java.util.List;
/**
* @PROJECT EucAlgo
* @PACKAGE com.tistory.seungdols
* @WRITTER Administrator
* @DATE 2015-10-30
@seungdols
seungdols / EucAlgoMain.java
Created November 26, 2015 12:31 — forked from choiseungho/EucAlgoMain.java
유클리드 호제법 / 확장 유클리드 알고리즘 - Euclid Algorithm
package com.tistory.seungdols;
/**
* @PROJECT EucAlgo
* @PACKAGE com.tistory.seungdols
* @WRITTER Administrator
* @DATE 2015-10-30
* @HISTORY
* @DISCRIPT
*/
@seungdols
seungdols / GetFilePath.java
Created November 26, 2015 12:31 — forked from choiseungho/GetFilePath.java
Class의 디렉토리 경로를 가져오는 방법
String path = GetFilePath.class.getResource("").getPath();//현재 자신의 경로
String path = GetFilePath.class.getResource("/").getPath();//classes의 최상위 경로
new File("").getAbsolutePath();//절대 경로
new File("").getCanonicalPath();//상대 경로
@seungdols
seungdols / AddActionListnerlambda.java
Created November 26, 2015 12:31 — forked from choiseungho/AddActionListnerlambda.java
기존 리스너 추가와 람다식 사용의 차이 - what different use AddListner and Lambda?
btn_search.addActionListener(e -> {
btnAction(e);
});
btn_search.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
btnAction(e);
}
});
@seungdols
seungdols / FileRename.java
Created November 26, 2015 12:31 — forked from choiseungho/FileRename.java
Input data를 통한 파일 이름/확장자 변경
package com.tistory.seungdols.file.rename;
import java.io.File;
import java.util.Scanner;
/**
* @PROJECT effectiveJava
* @PACKAGE com.tistory.seungdols.File.rename
* @WRITTER Administrator
* @DATE 2015-09-21