Geertjan's Blog

  • February 1, 2009

Twittering from NetBeans IDE

Geertjan Wielenga
Product Manager
Carl Dea (who I know via a series of articles I wrote about "Filthy Rich Clients" on the NetBeans Platform, of which part 1 is here), sent me an e-mail a few days ago to encourage me to join Twitter. I did so, today, and this is my Twitter nest (is that the correct word? I totally just made it up):


By the way, here's the NetBeans Twitter nest:


It wasn't long before I wanted to send my tweets from inside NetBeans IDE, instead of the web interface.

I found out here about Twitter4J. Right as I was thinking about how to integrate that into NetBeans IDE, I found out about Kishida-san's Twitter Plugin for NetBeans. While it seems to be doing the job perfectly well, it could go a few steps further. Firstly, it could become a better NetBeans Platform citizen by getting the user to set username/password in the Options window. Secondly, it could make use of explorer views rather than a JTable.

That's what I accomplished below and it's working exactly as one would expect:

I tried to put all the pieces around the editor, rather than within a window that dominates the IDE too much, because Twittering is always going to be an ancillary activity, rather than the central focus of NetBeans IDE users. So, for example, the status bar (thanks to this very simple instruction) contains the text field where I do my twittering. (Very simple: when I press Enter in that text field, the tweet is... twittered.) Notice also the Properties window, the Message window, and the explorer mode (which contains the images of my Twitter friends), all of which provide parts of the UI of the plugin. That, I believe, is how it is meant to be done. On top of that, there's an extension to the Options window, where the username and password are set, which are stored to the NetBeans user directory via the NbPreferences class.

Now, here's the puzzle for today. Which of the following coding activities do you think took up most of my time while creating the above plugin?

  • Understanding the Twitter4J API classes.

  • Figuring out how to resize the images.

  • Synchronizing the windows with each other.

  • Sending messages to Twitter from the IDE.

  • Initializing Twitter from inside the IDE.

What do you think? With which of the above do you think I had (by far) the most trouble? (I spent more time on this than on everything else put together.)

Join the discussion

Comments ( 5 )
  • Tom Potts Monday, February 2, 2009

    If you're anything like me, it would've been figuring out the third-party API. They're never as well-documented as people think. :o)

  • jfisher Monday, February 2, 2009

    so are you going to release it?

  • sameera Monday, February 16, 2009


  • sellerjd Thursday, March 12, 2009

    Did you make a plugin out of your solution or could you provide instructions on how to do this? Thanks!

  • Phil Wednesday, March 25, 2009

    Did you figure out how to send a tweet rather than a series of direct messages, using twitter4j?

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.