For customizing uitable there are a lot of good tips on http://undocumentedmatlab.com/. So I was trying to realize individual format for every cell of a table, as described in chapter 4.1.1 in undocumentedmatlab author's book.
Unfortunately I do not understand the Java-Matlab connection very well, so I was wondering whether someone already did this and that example and can give me some tips.
First I started at the very beginning and checked my java version and installed JDK:
version -java
Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
!javac -version
javac 1.6.0_45
Second I added the enviroment variable JAVA_HOME and edited PATH.
Third I downloaded the custom CellEditor Class, provided by undocumentedmatlab.com: LookupFieldCellEditor.zip, which contains the .java and the .class file. http://bit.ly/aiHumG
So now I am thinking I did everything necessary to start fusing Matlab and Java to costumize my uitable. For the start I just copied the main idea from the 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, this is not working. The error message:
No method 'put' with matching signature found for class 'java.util.Hashtable'.
I already searched a while and tried different stuff to get it work (like using keys for the hashtable, trying differnt types of inputs, etc.), but I think I am missing something general, caused by the lack of understanding.
Thank you in anticipation!