Win a copy of Head First Android this week in the Android forum!

Patel Chintan

Ranch Hand
+ Follow
since Mar 01, 2007
Ahmedabad, INDIA
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Patel Chintan

Hendra Kurniawan wrote:I need a regex to help verifying email address:
1. at least 2 letter before @
2. at least 3 letter domain name
3. at least 2 letters for extension

I've never used regex before, please give example. thanks

You may try like this -


this will take only word/char, you can append other thing in [] like to support digit you can add \d and so on.
9 years ago
You have to keep logic such that only X and Y coordinates will get change every time you re paint it.
g.fillOval(130, i, 20, 20);
11 years ago
If you just need to make animation for moving ball, then you don't need to use mutithreading. You can achieve this just using repaint method.
You just need to decide path for Ball, and keep repainting the ball.
11 years ago
Hi, I need to convert RGB image to CMYK. I tried with different code but didn't get any success. So to verify all conversion I just tried to read Image and again creating another image with RGB only. But I am not able to generate proper image. It just creates some parts only from original image.

Here is code to read and get RGB data array. I have created a list of RGB array(of pixel).

Here is code which I am using to re create Image from RGB array data.

If this works then I can try for CMYK image.
I can't understand what is going wrong with this, as I am new to image processing.

11 years ago

Jesper Young wrote:What is the variable timeZone in your code? Is it set to UTC or to some other timezone?

Is the string you are parsing a timestamp in UTC? Then you need to set the timezone on the SimpleDateFormat object too (to the UTC timezone, ofcourse).

timezone is UTC.
11 years ago
Hi I am having one problem while converting date format.
I am getting date as "2010-01-27 06:43:34" string in XML. I need to store it into UTC format.
but I am not able to do it.
Below is code:

it is returning "Wed Jan 27 12:13:34 IST 2010" output and I want it into UTC.

Thanks in advance.
11 years ago
Yes Trigger is the best option for this.


The only difference between StringBuffer and StringBuilder is that StringBuilder is unsynchronized whereas StringBuffer is synchronized. So when the application needs to be run only in a single thread then it is better to use StringBuilder. StringBuilder is more efficient than StringBuffer.
Yes Kelvin is right. You can store your map as an attribute in servletcontext.
And sorvletcontext is accessible to each JSP, so you can use it. and if property is going to change per request then you can set map as attribute in session object.

-Chintan Patel
11 years ago
you are using 'outstring' variable of String class, and String class doesn't have append method. You should use StringBuilder or StringBuffer class.

12 years ago
hi, you need to replace special characters with some other character string.

Check this URL:

12 years ago
Hi Jyoti,
In this case b1 will be GCed, and b2 will remain alive til class is loaded in memory.

aruna sameera wrote:what is the different between jsp and sevlet?
i mean wh ywe use jsp than servlet?

Basically both Jsp and servlet are same. As JSP is translated into servlet.
JSP is mainly used for your presentation part, means your GUI part, and servlet is used for your controller part or business logic part.
12 years ago

Niraj Pendal wrote:Hi,

I am developing an application using swing.

I am using confirmation Dialog box to ask for User confirmation.

JOptionPane.showConfirmDialog(this, "Are you sure want to delete?", "", JOptionPane.OK_CANCEL_OPTION);

Dialog box contains Java coffee icon on let left top corner(normal Java application icon).

In frame "frame.setUndecorated(true)" can solve my problem but how can I remove this icon from confirm dialogbox?

Please suggest me some solution. Provide me some code sample or any useful link.

Thanks in Advance.

Hi Niraj,
Visit this link:
12 years ago