This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hey everybody, I've been writing a simple chat program, and I was wondering about a few features that I haven't been able to figure out just yet.
1. How do I set the scroll bar's position manually, via code.
2. How do I call a method from a keystroke?
I plan on putting a method call to whatever method number 1 entails at the end of the while loop in IncomingReader's run() method, and I'd also like the program to be able to send the user's message when they press ENTER.
Rather than implement Action, I'd try having having your class extend AbstractAction. This way while it has to implement the actionPerformed method it only overrides the other Action methods that you think are necessary (or none at all).