- Joined
- Mar 3, 2013
- Messages
- 2
- Reaction score
- 0
Help Please.
How to put text in notepad to Jtable with spit in "-" ? I would like the exact column and row.
Column Code:
This is my reader:
And this is my textfile in Notepad:
How to put text in notepad to Jtable with spit in "-" ? I would like the exact column and row.
Column Code:
Code:
private String col []= {"Account No.","PinCode","First Name",
"Last Name", "MI","BirthDate","Sex","E-mail","Location"};
This is my reader:
Code:
try{
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("Database.txt"))));
String line;
int j = 0;
line = br.readLine();
String data[] = line.split("-");
String matrix[][] = new String[data.length][];
model = new DefaultTableModel(matrix, col);
table = new JTable(model){
public boolean isCellEditable(int row, int column){
return false;
}
};
}
catch (IOException ex){
ex.printStackTrace();
}
And this is my textfile in Notepad:
Code:
07-12345-wilson-dacles-t.-February 1, [email protected]
21-1234-wilson-dacles-t.-February 1, [email protected]
0721-070707-rommellyn-dacles-m-March 7, [email protected]