|
![](/images/resource/spacer.gif) |
|
Java GUI - ขอตัวอย่าง เมื่อเราคลิกข้อมูลจาก JText Area แต่ละบรรทัด แล้วให้มาแสดงที่ Jlable |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ขั้นแรก Split ข้อมูลใน JTextArea ด้วย \n ครับ
Code (Java)
public static void main(String[] args){
String myString = txtTextarea.getText();
String[] data= myString.split("\\n");
String header[] = { "Column 1" };
// Table
JTable table = new JTable(data,header);
table.setBounds(36, 37, 407, 79);
getContentPane().add(table);
}
Java Table (JTable) - Swing Example
ประมาณนี้ครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2014-06-06 14:13:27 |
By :
mr.win |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
Load balance : Server 00
|