Twitter4j Twitter OAuth Example

Today I’m going to show you some sample code regarding how to send a tweet to twitter using twitter4j and OAuth. The following code example is a command line twitter client that authenticates a user with oAuth and allows them to post a tweet.

All you need to to create a project in your favourite IDE.. for ease of use. Add the twitter4j library to your build path. Compile and run. If you run into any problems shoot them into the comments and I’ll lend a hand. Happy hacking.

Read More

One Way Tweet a Java App

One way tweet is a sending application for twitter. In this tutorial you will see/learn how to send stuff to twitter by writing a java desktop UI. You will create a new project in NetBeans and choose java application, and create a new package called

Then, create a new java source file and call it, and another called Two simple classes and you’ve got yourself a twitter client. The end result will look like this:
One Way Tweet
Read More

Creating a PDF Programmatically with iText

All will agree that pdf’s are cool, right? So, In this brief tutorial I will be describing how to create a pdf programmaticallywith NetBeans and how to add the iText library to your NetBeans projects. As is always the case this tutorial is intended to wet your appetite for the iText library. When you get serious you’ll want to create shapes and play with colors. In this tutorial I will show you how to create a pdf that shows a big Hello World at the top and draws eight squares underneath it. Here is the finished product, you can play around with the collors and draw loop to add more effects.

First thing you will need to have a copy of NetBeans. And also a copy of the iText Core jar. In Netbeans you will want to create a new project, call it “HelloWorld”. A this point you should create a new package, call it “pdfbuilder”.

Right click the package pdfbuilder you’ve just created and select New > Java Class:

Creating a New Java Source File

You will need to give the class a name so for this example you should call it HelloWorld then hit finish:

Naming a Java Class

Read More