SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
K. Tsang wrote:Sorting rows and columns are not hard with tables. But I found that out at the beginning, when I sorted mine the table row and my record number matching screw up. Oh I was using the table setAutoRowSorter(true) thing.
At the end I didn't bother with sorting. And a column model is needed to not screw up the record number. It's your choice.
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
Regards
SCJP, SCJD
Axel Leucht wrote:I do sort the table.
So I stick with lexical sorting.
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
SCJP 1.4 -- SCJD Java 2 -- OCM JEA 5
Axel Leucht wrote:I do sort the table.
Only problem is the rate field (I'm doing the URLyBird assignement) which has the curreny symbol included. Sorting on that column gives the lexical sorting and not the expected (numerical) sorting order. But I don't bother with this problem as I find that user expect the table to be sorted by clicking on the header. I can't think of an appripriate way to extract the currency information from the string field. Nowhere it is mentioned that the currencyl smybol is ISO 4217-compliant. So I stick with lexical sorting.
I only had to make sure that any selectred row stays selected after performing a search as the selected row might change and I have to find it again after the search operation and reselect it.
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Yucca Nel wrote:
You need to use a comparator for the record value object. Then what I did was substring whatever is after the currency symbol and cast it into a Double. Then use the compareTo(). This needs to be done for the rate field. The size field (if you have one also needs to have a comparator).
Regards
SCJP, SCJD
Axel Leucht wrote:
Yucca Nel wrote:
You need to use a comparator for the record value object. Then what I did was substring whatever is after the currency symbol and cast it into a Double. Then use the compareTo(). This needs to be done for the rate field. The size field (if you have one also needs to have a comparator).
I know how to do it with a comparator.
Problem are with currencies more than one character long. For example the Denmark Kroner is abbreviated as 'kr', (two character) and the Switzerland Francis 'CHF' (three character).
But I will write a comparator for the size Attribute, which I forgot. I'll look into whether I can parse the currency with a regex-pattern.
SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Regards
SCJP, SCJD