שאלה קטנה.....דחופה!!!

koral1000

New member
שאלה קטנה.....דחופה!!!

אני מתכנתת בJAVA וכעת אני משתמשת בטבלה.....(JTable)-שהוספתי אותה לframe אני רוצה לשלוח לטבלה string מסוים ושימחק לי את השורה שהstring הזה מופיע בתוכה! איך עושים את זה?
 

DCoder

New member
Implement AbstractTableModel

You should extend AbstractTableModel, and save a HashMap holding all current values of a chosen column. Now, all you need to do is add a method which would first check if the value is in the HashMap, and if so, delete the row from your data structure. Next, you´ll need to revalidate/repaint your table. There´s a pretty good example in Bruce Eckel´s fine book - Thinking in Java, which you can download for free, or buy. You should also read the full JTable API. P.S. There´s no need to repost a question just one hour after first posting it.
 
למעלה