Tag Archives: JPanel

Further improvements

12 May

Welcome back to the Twitthere blog! Today I had some time left for Twitthere, so I started improving the proof of concept I posted yesterday. I added a simple colour scheme, aligned the username and the text of the tweet, added the user icon to the panels and put in the date and source of the tweet. In short, that’s just about every basic piece of information a tweet should contain. Try it yourself and see if it works (the current prealpha only shows your Home timeline).

Download the latest version of Twitthere from SourceForge: http://sourceforge.net/projects/twitthere/files/

I also added the option to remove your own tweets (because it is only possible to remove your own tweets in your Home timeline). To make sure no accidents occur and no one sues me for removing their beautiful tweets, I built in a small confirm dialog to make sure you really want to delete it. It is still kinda buggy though, because if you delete one of your own tweets, for some reason the mouse scroll stops working :S The tweet is also deleted from Twitthere but there is no animation or anything, so the other tweets just shift up immediately (which is kind of ugly).  But fixing the bug and working on the eyecandy have to wait, because it’s time to go to bed.

— Léon

Proof of concept

11 May

Finally! Tonight I had some time left before I went to bed to work on Twitthere. My hands were itching with excitement because the fun part now starts. The whole OAuth cycle is just to support the main application, and that is of course a Twitter application. So, the first things I worked on today was to make sure all tweets and timelines were correctly imported from the API, copying them to a local ArrayList to save on API calls, which are rate limited. I created a wrapper class around the Status class provided by Twitter4j to make my own customizations in the future. So, now the Tweet class exists and every tweet on Twitter is an instance of Tweet in Twitthere.

Twitthere showing my Home timeline

The second thing I wanted to work on was the main window. Because I read an interesting article on advanced GUI creation in Swing, I was sort of experimenting with several JPanels when I actually found something that looked okay. So I implemented all the new methods I created in Tweet and TwitterUser to generate the Home timeline of a user. Although I’m not impressed by the design (far from it) or the way of presenting the tweets, it is a proof of concept which shows that there is light at the end of the tunnel 😉

If you are interested in my small creation, have a look at the screenshot below or download a copy from SourceForge.net: https://sourceforge.net/projects/twitthere/files/ . Of course you can also download the updated javadoc there.

Please feel free to leave any comments, let me know if it works and especially let me know when it doesn’t.

— Léon

First JFrame

3 May

Today I finally found some time (in college) to start creating the first JFrame with some panels. I chose to use a CardLayout JPanel with which I can show the complete login and authorization process in one JFrame. The panels I created are a login panel, shown when Twitthere is not run for the first time (so there are entires in the token file) and the loading screen shown when you log in.

Today or maybe tomorrow I will als create the other panels needed for the OAuth process, and maybe even start programming them so they actually do something!

Furthermore I updated the javadoc on SourceForge so if want the new version, go and grab it here:

Documentation
https://sourceforge.net/projects/twitthere/files/documentation/twitthere-0.1-javadoc.zip/download

Let me know if anything is wrong or you came up with a better solution!

— Léon