Skip to main content

Posts

Lightning

This summer temperature is setting new records... I think its because of "Global Warming", because last few summers temperature is increasing more n more. But yesterday there was raining in Pune. Following are some snapshots of lighting that I captured from my terrace

Using JTable

JTable is the component which helps us to display the multi columned data. This post is about fetching database data and displaying it using JTable. First we will design our Frame public class MyFrame extends JFrame {  private JTable table;  private JScrollPane jsp;  public MyFrame()  {   super("MyFrame");   setSize(400,400);   setDefaultCloseOperation(EXIT_ON_CLOSE);   setLocationRelativeTo(null);   initMyFrame();   setVisible(true);  }  private void initMyFrame()  {   setLayout(new BorderLayout());   table=new JTable();   jsp=new JScrollPane(table);   add(jsp,BorderLayout.CENTER);   // database connection and remaining code will go here  }  public static void main(String args[])  {   new MyFrame();  } }

Creating Simple Dll

This post is a tutorial for creating a simple dll in C++. So lets get started,  Create new project " SimpleDll " in Visual C++. If you are using Visual C++ 6.0 then select Dynamic Link Library Project and if you are using 2005 then select Win32 Project and select Dll and Empty Project in Additional options. After this add new header file " simpledll.h " to our project and add following code in header file . // SimpleDll.h #ifndef _SIMPLEDLL_H_ #define _SIMPLEDLL_H_ #include // this is the function which we will export VOID ShowMessage(WCHAR msg); #endif

Creating Executable Jar File

Creating a Executable Jar file is a very easy task until you don't know how to do it!! If you are using Eclipse for Java Application development then its more easier than using command line, Following are the steps for creating Jar file - using Eclipse 1. Right click on your project and select Export from popup menu

Building small utilities

Another day in office, got extra task to do other than office work!! Task is to build a small utility which will replace all occurrences of a pattern in all project files with another pattern. Use of regular expression made id it easy to complete the task and the utility is built. :)

New LookAndFeel in JDK7

In next release of JDK i.e. JDK 7, it contains many new features. One of them is addition of new LookAndFeel - Nimbus. Following screenshot shows the demo of Nimbus LookAndFeel . You can download the Source Code for the demo which is shown in above picture. Download -  LookAndFeelDemo For running this demo you must have JDK7 installed on your system.