Twitter Search Desktop Application

A starting application

You've been provided with a starting Twitter application. This application has a graphical user interface with a 'search' button, a query box where a user can enter search terms, and a display area where search results can be displayed. When the user enters a search term in the query box and hits return (or clicks the button), the application uses the Twitter API to search for recent tweets that contain the search terms. It displays up to 15 of them in the display area.

Getting set up

Although the application itself is pretty simple, the Twitter API that it relies on is not. There are a few steps you'll need to take to get this code ready to run on your machine. I've tested this on a Windows machine using NetBeans. The same code should work on most other machines, but you need a terminal capable of graphical displays (so not putty or xterm).

If you're able to do all that correctly, you should be able to run the twitter.TwitterApp class, and it should bring up a window that looks like this:

You should also be able to type keywords into the text field and perform searches for tweets. (Your machine needs to be connected to the Internet for the search to work.)

Main Assignment (10 points): Add the capability to search for users

The Twitter API includes methods that allow programs to search for keywords, as well as to search for Twitter users. The first part of your homework will give you practice with building a graphical user interface (GUI), and practice with the Twitter API. Your job is to add another search button to the interface with the label "search user". When this button is pressed, the application should display the most recent tweets from the user whose name is entered in the query box. If no matching user is found, it should display a message saying "no such user found." All search results and messages should appear in the display area, not in System.out.

Extra Credit (4 points): Create a useful subclass and implement an interface

For extra credit, you are allowed to add whatever functionality you want to your Twitter App. Be as creative or boring as you like. There are lots of advanced functionality that the Twitter API provides; check out the documentation in the javadocs for more information. There are also lots of options for making a more creative and interesting user interface; for this, check out the javadocs online for Java's java.awt package, or check out this tutorial.

There are a few requirements for this part, however. Here they are:

suggestions

Design first, then code! You will be graded partly on the design of your program.

Debugging with graphical interfaces can be tricky. Try using the "display area" to display information for debugging, until you have everything working properly.

what to turn in

Turn in a zip archive to your TA containing:

You should NOT turn in the twitter4j jar file, or the twitter4j.properties file.