Friday, October 9, 2009

Integrate Crystal Report with J2SE Swing application

The Java Reporting Component (JRC) in Crystal Reports XI Release 2 supports the ability to deploy applications in web and desktop environments. The JRC also includes APIs for server-side exporting and printing of reports, as well as for accessing information about a loaded report such as parameters and database information.

It is possible to deploy the JRC in one of two ways:

1. Embedding the JRC into a desktop Java application. This method requires deployment of the JRC runtimes and thick-client Swing viewer libraries in a desktop application, which is installed on client computers.
2. Embedding the JRC into a J2EE web application. This method involves the deployment of the

JRC runtimes with the zero-client DHTML Viewer in a web application archive (WAR) file.

The JRC is a 100% pure Java reporting engine that allows developers to embed reporting functionality directly into desktop and web applications. The JRC is best suited for delivering simple on demand reports to small departments or workgroups. For serving reports to larger user bases over the web with security, and scalability and fault tolerance, the Crystal Reports Server or BusinessObjects Enterprise Java SDK is recommended.

Here is a sample project:

You just open the project code by Eclipse IDE, compile with java 1.4 or 1.5 , run it and then you will see window appeared as image above.

Project Code:

I recommend reading this documentation for more understand how to set it up:

Thursday, October 8, 2009

Sample project using GWT/GWT-Ext/Spring/Hibernate/ORACLE - CRUD

In May of 2006, Google released the Google Web Toolkit (GWT), a set of development tools, programming utilities, and widgets, allowing you to create rich Internet applications differently than you might have done before. The difference between GWT and all of those other frameworks, is that with GWT you write your browser-side code in Java instead of JavaScript. For those of us that rely on Java as a trusted tool this is really a monumental difference over traditional JavaScript coding. It means that besides gaining all of the advantages of Java as a programming language, you also get immediate access to a gazillion Java development tools that are already available. Instead of trying to build a new tool to support the development of rich Internet applications in JavaScript, Google has altered the language that we use to write these applications to Java, allowing us to use the tools that already exist.

GWT provides a set of ready-to-use user interface widgets that you can immediately utilize to create new applications. It also provides a simple way to create innovative widgets by combining the existing ones. You can use the Eclipse IDE to create, debug, and unit-test your AJAX applications. You can build RPC services to provide certain functionalities that can be accessed asynchronously from your web applications easily using the GWT RPC framework. GWT enables you to integrate easily with servers written in other languages, so you can quickly enhance your applications to provide a much better user experience by utilizing the AJAX framework.

Following is a short summary of these features:

  • Full Java 5 language support (such as generics, enumerated types, annotations, etc.).
  • A Java-to-JavaScript compiler with hosted mode emulation, allowing full support for Java
  • Browser independence—quirks and history management issues are dramatically reduced.
  • Basic widget support for buttons; forms; elements; simple tables; and tree widgets, dialogs, and panels.
  • Support for a range of server integration and communication options (RPC, XML, or
  • JUnit testing support and integration.
  • Internationalization language and locale support.

Here is an example project i have created by implementing together the new technologies: GWT 1.7, GWT-ext 2.0.6, Spring 2.5, Hibernate 3, JSON and Oracle database 10g express edition.

This project includes a CRUD operations related to the basic product data, i provide as well an operation for uploading photo or binary data. I believe this sample project could give some insights for java developers who is getting start using this kind of technology.

I use WindowBuilder Pro IDE 7.1 plugin for eclipse 3.4, it's a powerful and helpful editor, but it is not an open source like Netbeans IDE.

I've actually accomplished a website for Central Sign CO.,LTD. with these technologies for some part of it.


Auto mouse click by Java Robot

Java.awt.Robot class is used to take the control of mouse and keyboard. Once you get the control, you can do any type of operation related to mouse and keyboard through your java code. This class is used generally for test automation.

This sample program show the use of Robot class to handle mouse right click. If you run this code you will see the right click menu popup automatically for each two seconds.

i have written this program for my friend request to use in some PC game (RPG) playing, instead of using hands clicking on mouse but you let this program do it for you.

If you are Java developer, you can modify this program to fit your needs by using Netbeans 6.7 IDE and Java 5.