A few years ago I wrote a Soduko solver in Java. Works great, except I have to edit the source file to change the input because I could never get Swing to work like my mental model said it should.
Cut to now, I want to figure out Swing. Each cell takes a single character, 1-9 or " ". The space could be 0 and I can deal with that elsewhere if need be. If a valid character is entered move to the next box, otherwise set the cell to " " (or 0) and stay on that cell. Of course, the user can click on any cell to focus on it.
I've got it working (out of frustration) with a JComboBox. But it's ugly. Man is it ugly.
Seems a JTextBox is the way to go but I'm not having much luck wrangling it into what I'm trying to do. Ideally for every character typed it would generate an event. My event handler would validate the input, if good use the value and goto the next cell. If validation fails leave the existing value alone and stay on this cell.
Not really looking for code, more like a roadmap of terms to feed Google. I suspect what I'm really missing is the list of various events I can (should) handle.
Cut to now, I want to figure out Swing. Each cell takes a single character, 1-9 or " ". The space could be 0 and I can deal with that elsewhere if need be. If a valid character is entered move to the next box, otherwise set the cell to " " (or 0) and stay on that cell. Of course, the user can click on any cell to focus on it.
I've got it working (out of frustration) with a JComboBox. But it's ugly. Man is it ugly.
Seems a JTextBox is the way to go but I'm not having much luck wrangling it into what I'm trying to do. Ideally for every character typed it would generate an event. My event handler would validate the input, if good use the value and goto the next cell. If validation fails leave the existing value alone and stay on this cell.
Not really looking for code, more like a roadmap of terms to feed Google. I suspect what I'm really missing is the list of various events I can (should) handle.