Top.Mail.Ru
December 14th, 2005 - Java developers — LiveJournal
? ?

Java developers

December 14th, 2005
Image

10:46 am - Imagelocalstorm - The issue

So, I have an issue again. Unfoturnately, I have no rich experience in Swing. My issue has two sides:
1. I'm using Jlist. Every item is an image and a caption underneath. But idems rendering depends on lengths of the captions. If I call setFixedCellHeight() or setFixedCellwidth() it made my captions truncated and user couldn't see full caption. I want to achieve an effect like in Windows Explorer. Items are one under another (they are lined up, captions are truncated if they are too long) but when I select any item, I can see full caption in any cases.

2. How about area selection? I can easily select all icons with rectangle area, using my mouse pointer. How to switch on such selection method for JList?

I've posted it on forum.java.sun.com some days ago, but still no response. May be anyone can help me?
Image

05:46 pm - Imagevalera - Scrabble algorithm

Can someone help me out with an algorithm for validating playing input in a scrabble game?
Basically two structures are being used for data at that point: the Board, which holds info about what's in every tile, and a letterBuffer, which is a vector of only those letters that the player used in the turn.

First (and only) thing I'm doing right now is checking whether everything the player used in the turn is on the same line. I just go through the letterBuffer vector and make sure that it either has all the same X coordinates or all the same Y coordinates.

What I still need:
1) make sure that there are no white spaces between the letters used in the turn. There can be letters from previous turns between them, but skipping white space is not permitted.
2) every letter placed on the board that has another letter adjacent to it must make a word on that line.
3) collect all the words made in this turn
4) verify that the words are valid words

2 & 3 & 4 are related in the sense that i could collect all letter combinations made in the turn, and then verify them against a dictionary. so 2 & 3 could be replaced by "collect all letter combinations made in the turn". which.. is problematic.

so, any suggestions?

cross-posted to Imagewebdev
Powered by LiveJournal.com
Image