Saturday, August 22, 2009
Have you ever wanted your Form(java.swing) to be displayed on the center of your screen?????
Here's a method to do so...
First you have to import two packages ....
import java.awt.Dimension;
import java.awt.Toolkit;
Next go to the design view of your form & click on the form. In the properties of the form see what's the prefferedSize is.
say, prefferedSize = [426,473]
here 426 is the width of your form, & 473 is the length of the form.
Next initiate following variables,
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
//this will get screen dimensions
int X = (screen.width / 2) - (426 / 2); // Center horizontally.
int Y = (screen.height / 2) - (700/ 2); // Center vertically.
here 426 is the width of your form & 700 is a value which makes your form vertically centered.
But you can change this 700 according to the vertical position you want.
Next again go to the properties of your form & go to bounds.
There select Custom Code & enter the following line.
this.X,this.Y,426,473
here 426 is the width & 473 is the length of your form.
Then press ok & check again whether the code line you entered is there.
Now run your form & see.
Tuesday, August 18, 2009
Convert java applications to .exe
So I decided to have a go in Google Search again. Accidently I have found a software that works userfriendly. :P So I thought of sharing that. It was named as "exe4j".
here's the link to download.
Click Here
(Please note that this is an evaluation copy)
Here's the way......
1. Extract the ZIP file.
2. Goto 'bin' folder inside the 'exe4j' folder.
3. Next double click on 'exe4j.exe' file inside the 'bin' folder.
4. Follow the steps!!!

In this welcome screen jus press NEXT

here just select the Regular Mode & press NEXT

here give a name to your project, select a path to a folder where you need to place your .exe file, just leave other field blank & press NEXT

If your application is a GUI select 'GUI application'.Give the name that you want. (if you give 'sun', you get a 'sun.exe' file)
If you want to add an icon image(.icon) to your final .exe file select 'Icon file' & choose an icon.
Then press NEXT

First provide the class path by clicking on '+' mark at your right hand center. Then a dialog box will pop up. In the archieve field give the path of your '.jar' file. Press ok. Then in Main Class field give the path of your 'main class'. Then press NEXT.

In Minimum Version field just put 1.3
Press NEXT.

For the simplicity just select No splash screen
If you select exe4j splash screen, you have to give an image file(.GIF image etc.)
Press NEXT.
Just click on NEXT in stage 8.
After that in stage 9 it will create the .exe file.
Finally we have done with it!!!! To start application immediately press 'Click here to start application' or else go into the folder that you gave earlier.
It is very user friendly!!! Have a GO!!! Hope you too enjoy it !!
Hiii All......
All this time I had my Level 2 semester 2 exams + Preparation for the Programming Competetion + My Personal Projects + many more.....
I was really happy until I receive my Acoustics results(Don't ask me the result(I have passed it anyway)). Do you beleive at the start of the semester it was the easiest subject :P . I have applied for a recorrection... & hoping against hope that it will change(Oh God help me!!!).
So, I wish that I will continue blogging without any pauses!!!
regards,
Nirmal
Friday, April 3, 2009
Google Summer of Code-2009
I have chosen the project Survey Application under the XWiki Organization.
You can find it by clicking here. I expect valuable comments of you all.
Thanks!!!!
Sunday, October 19, 2008
Mother Teresa of Calcutta

Mother Teresa of Calcutta (August 26, 1910 – September 5, 1997), born Agnes Gonxha Bojaxhiu, was an Albanian[2][3] Roman Catholic nun with Indian citizenship[4] who founded the Missionaries of Charity in Kolkata (Calcutta), India in 1950. For over forty five years she ministered to the poor, sick, orphaned, and dying, while guiding the Missionaries of Charity's expansion, first throughout India and then in other countries.
By the 1970s she had become internationally famed as a humanitarian and advocate for the poor and helpless, due in part to a documentary, and book, Something Beautiful for God by Malcolm Muggeridge. She won the Nobel Peace Prize in 1979 and India's highest civilian honor, the Bharat Ratna, in 1980 for her humanitarian work. Mother Teresa's Missionaries of Charity continued to expand, and at the time of her death it was operating 610 missions in 123 countries, including hospices and homes for people with HIV/AIDS, leprosy and tuberculosis, soup kitchens, children's and family counseling programs, orphanages, and schools.
She has been praised by many individuals, governments and organisations; however, she has also faced a diverse range of criticism. These include objections by various individuals, including Christopher Hitchens, Michael Parenti, Aroup Chatterjee, Vishva Hindu Parishad, against the proselytizing focus of her work; this included baptisms of the dying, a strong pro-life stance on abortion and a belief in the spiritual goodness of poverty. Several medical journals also criticised the standard of medical care in her hospices, and concerns were raised about the opaque nature in which donated money was spent.
Following her death she was beatified by Pope John Paul II and given the title Blessed Teresa of Calcutta.
Ajantha Mendis....
Balapuwaduge Ajantha Winslo Mendis (born March 11, 1985 in Moratuwa) is a cricketer who plays for the Sri Lankan national cricket team.
Mendis, although classified as slow-medium, bowls a mixture of deliveries, including googlies, off-breaks top-spinners, flippers and leg-breaks, as well as a Carrom Ball, released with a flick of his middle finger. For Sri Lanka Army in 2007-08 he averaged a mere 10.56 and took 46 wickets in six games, his strike rate a startling 31. This gained him a call-up to the full Sri Lanka squad for the Caribbean tour in April 2008.
His best bowling performance in a one-day international came in the final of the 2008 Asia Cup, where he took 6 wickets for 13 runs in just his eighth match. His 17 wickets in the tournament earned him the Man of the Series award.[1]
Mendis made his One Day International debut against the West Indies at Port of Spain in 2008 and took 3 for 39. He also plays for the Kolkata Knight Riders in the Indian Premier League.
His first Test Match was against India at Colombo on July 23, 2008 in which he returned match figures of 8-132, thereby becoming the first Sri Lankan bowler to get an eight-wicket haul on Test debut.
Ajantha Mendis won the Emerging Player of the Year award at the LG ICC Awards ceremony held in Dubai in September 2008.