![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Professional Programmer
Join Date: Oct 2006
Posts: 257
Rep Power: 2
![]() |
Re: GUI problem.
oh, right, lol. thats embarassing. And thanks for the method name, I was obviously confused there at first. I will do that since I tried quickly rewriting something but it wasn't the source of the problem.
Also, note that if any of you runs this, it won't work, since the ArrayList isn't there from the other file or something of that nature. |
|
|
|
|
|
#12 |
|
Professional Programmer
Join Date: Oct 2006
Posts: 257
Rep Power: 2
![]() |
Re: GUI problem.
getPropertyName() gave me back "value", which doesn't tell me anything; I could have known that value was what was changing just because its what has to be changing in order to trigger the teamField source. I am going to look into more of the methods available, but I think it can't be solved using those methods...
|
|
|
|
|
|
#13 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
Re: GUI problem.
This page: http://java.sun.com/developer/JDCTec.../tt0518.html#1 shows how to use an InputVerifier to check the contents of a field before allowing you to move off it. It might do what you want.
|
|
|
|
|
|
#14 |
|
Professional Programmer
Join Date: Oct 2006
Posts: 257
Rep Power: 2
![]() |
Re: GUI problem.
Thanks but I already found the error. But thanks for your help, it was definitely good since it told me what wasn't the problem. Sometimes knowing what the problem isn't is just as useful as finding out what it is.
Btw, I thought about the Formats, and ventured a guess and it worked. All I did was change where it says new JForTextField(new String()). I added the String part. lol. I have already done a lot of reading about this stuff so I was like wtf. But I didn't realize that you absolutely had to set up a specific format for the text field... I assumed it was String by default, and setting it up was for fancy stuff, like if you wanted the user to enter a date (thats one example they have) |
|
|
|
|
|
#15 |
|
Professional Programmer
Join Date: Oct 2006
Posts: 257
Rep Power: 2
![]() |
Re: GUI problem.
Ok I have another problem, one we already discussed. When it prints out the error message (Re-enter team name or whatever it says) the act of printing that out fires a PropertyChangeEvent. And that is definitely not what I want to happen. I can figure out ways around this, such as a simple variable, to just ignore the second PropChangeEvent. But is there any proper way of programming it so that it either doesn't fire a PropertyChangeEvent in that case, or something similar?
|
|
|
|
|
|
#16 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
Re: GUI problem.
What about putting another text output next to (or below) the field and put the error message in that? It would be very frustrating to type in a team name, accidently transpose two letters, then have to type the whole name again because the program wiped out the name with an error message.
|
|
|
|
|
|
#17 |
|
Professional Programmer
Join Date: Oct 2006
Posts: 257
Rep Power: 2
![]() |
Re: GUI problem.
I mean... I already fixed the problem like I had said with the variable thing. I just added a counter. I was just wondering if there is a way to avoid this problem altogether, because I would think there would be something simple that I'm missing. I apologize if thats wasting your time to respond to a question which isn't really a problem, but I'm here to learn. I'm more concerned with doing things correctly than "ok, that works, so lets move on".
|
|
|
|
|
|
#18 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
Re: GUI problem.
I would have done it with a variable flag, same as you. There may be a proper way to switch off the PropertyChangeEvent firing altogether, but I don't know of it. I hadn't even heard of a PropertyChangeEvent before this thread.
I was just pointing out that overwriting a user's input because they made a mistake is not going to win any user-friendliness awards. |
|
|
|
|
|
#19 |
|
Professional Programmer
Join Date: Oct 2006
Posts: 257
Rep Power: 2
![]() |
Re: GUI problem.
Oh, I see what you mean. Well since I am doing this for free... and the input that is going to be there is going to be short, probably one word... I'm not concerned. This is one section of a much larger project. I will post the project on this site once it is finished. Maybe. Because I'm writing it for free since its for my mom. But if there's a possibility of selling it to others she knows, once I refine it, then I'll do that.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Challenging Programming Problem - "Pinball Ranking" | Sane | Coder's Corner Lounge | 38 | Jan 15th, 2008 5:16 PM |
| Problem solving | ReggaetonKing | Software Design and Algorithms | 7 | Jan 4th, 2008 1:49 PM |
| Storing BLOBs in a database - problem | jonyzz | Other Programming Languages | 8 | Jan 31st, 2007 4:38 AM |
| Changing icons problem | Pedja | C# | 8 | Mar 25th, 2006 8:03 AM |
| cgi/perl script + IE problem | joyceshee | Perl | 2 | Jan 24th, 2006 11:10 AM |