Wednesday, 15 May 2013

matlab - Using Java to customize uitable with hashtable -



matlab - Using Java to customize uitable with hashtable -

for customizing uitable there lot of tips on http://undocumentedmatlab.com/. trying realize individual format every cell of table, described in chapter 4.1.1 in undocumentedmatlab author's book.

unfortunately not understand java-matlab connection well, wondering whether did , illustration , can give me tips.

first started @ origin , checked java version , installed jdk:

version -java

java 1.6.0_17-b04 sun microsystems inc. java hotspot(tm) 64-bit server vm mixed mode

!javac -version

javac 1.6.0_45

second added enviroment variable java_home , edited path.

third downloaded custom celleditor class, provided undocumentedmatlab.com: lookupfieldcelleditor.zip, contains .java , .class file. http://bit.ly/aihumg

so thinking did necessary start fusing matlab , java costumize uitable. start copied main thought book:

mtable = uitable; set(mtable,'columneditable', [true, true]); fieldshashtable = java.util.hashtable; fieldshashtable.put('meat',{'steak','veal'}, 1.99); fieldshashtable.put('vegetables',{'salad','lettuce'} , 2.50); jtable.getcolumnmodel.getcolumn(1).setcelleditor(ed);

surprise, not working. error message:

no method 'put' matching signature found class 'java.util.hashtable'.

i searched while , tried different stuff work (like using keys hashtable, trying differnt types of inputs, etc.), think missing general, caused lack of understanding.

thank in anticipation!

i think usualy

put(key, value)

you calling

put(key, something, value)

consider using other info structure.

put({key,something},value); put(key,{something,value});

or utilize 2 tables.

java matlab matlab-uitable

No comments:

Post a Comment