File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UB search result view problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UB search result view problem" Watch "UB search result view problem" New topic

UB search result view problem

K. Tsang

Joined: Sep 13, 2007
Posts: 3134

Hi all, I have a question, in my JTable I delete a record in the middle. The table view is updated nicely. Now I do a search for anything that would include that deleted record, I got the number of records correct but somehow the view shifted down by x record. I printed my record numbers search results out and they are correct.

In my table model I use a map to store the data. I want to ask if I populate mapA with values, then do

mapB = mapA;

would this be the same as doing


I want to use mapB ultimately.

K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
Roberto Perillo

Joined: Dec 28, 2007
Posts: 2271

Hello, my buddy!

Well, I know this isn't the answer you were looking for, but did you choose to offer a delete functionality in your GUI? This isn't really required...

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
K. Tsang

Joined: Sep 13, 2007
Posts: 3134

Yes Rob, I did implemented delete in my GUI as well as create. I know they are not require but without doing in GUI how possible will I do my Data class file really works and ultimately it's all in the table view.

Talking about my problem, I figured it out by figuring the exact key in my map using loops. You know finding these indices can be a pain when you know everything works in the back end.
Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
You can always use unit tests to test your Data class.

SCJP 1.4 100%
SCJD 99.5%
Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 232
I suggest using jUnit, since you can simulate multiple connections at the same time. That is, testing your locking mechanism.

SCJP 5.0, SCJD URLyBird 1.3.3, OCMJEA 5 (SCEA) Factory Homes
I agree. Here's the link:
subject: UB search result view problem
It's not a secret anymore!