Re: [問題] JTable 欄位輸入內容控制的問題

看板java作者 (骨頭)時間19年前 (2006/04/13 17:25), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
※ 引述《cpqq (cpqq)》之銘言: : 歹勢,我又來亂了 : ※ 引述《TonyQ (骨頭)》之銘言: : http://jsourcery.com/output/sun/j2se/j2sdk/1.4.2_04/ : 這裡有api的source code,但是我找不到jtable是怎麼用 : hashtable來決定editor的... 我上面舉的例子是Renderer -.- 不是editor jtable沒有用hashtable決定啊 jtable它只在乎它getTableCellRednererComponent()方法中 return 後面寫的東西而已 (笑) 會用hashtable是因為我們希望讓它的內容可以有多種變化 所以才會用Hashtable 我現在腦袋有些紊亂 沒辦法表達的很清楚 簡單來說 那個hashtable 在這裡的功能就跟switch的意思有點像 (這個比喻好像有點爛...目前能想到的最佳比喻了) jtable的這個機制,我不知道要用甚麼東西來形容比較好 XD 總之 它就像是一個函數 你給它一個 f(x) 就要有一個對應的 y 但是他並不管你y是怎麼存或者怎麼得來的 你愛用array存、愛用hashtable存、愛用list存 那都無所謂 只要你能確定當他get的時候回傳正確的東西給它 就ok -.- jtable沒有用hashtable去決定要取得甚麼 是程式的撰寫者(就像你我) 決定用hashtable去回傳這些東西的 : 拍寫,俺資質駑鈍,這裡我不太懂,我是覺得蠻奇怪的,TableCellEditor : 本身是一個interface啊,但是就我所知該作者的implementation就好像 : 假設有個interface InterfaceA 是 InterfaceB 的 Subinterface : public class XXX implements Interface_A { : protected Interface_A a; : public Object getSomething() { : return a.getSomething(); : } : } : 這樣有算是implement Interface_A 嗎? 還是我有觀念沒弄懂?? : 謝謝! 你的範例碼跟問題都跟interface_b無關耶 -.- 我實在看不懂你在問甚麼... 我想你的問題可能是 implements subInterface跟superinterface的問題吧?? implements subInterface 印象中是等於implement superinterface的... 不過 這跟你要用的這些東西其實沒有很直接的關聯吧 - -;; -- 既然寫local還是會被回文轉出去 (真是的 -.-;;) 那乾脆就不local了.. -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the complier will stack.push(scouting.buck()); | answer your life stack.push(bowling.pratice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.240.57
文章代碼(AID): #14FXaZcy (java)
文章代碼(AID): #14FXaZcy (java)