dear frnd
help me to solve a problem
I want to show search result on form which has a number field,
as numbers are in simple formate of integer column(without commas),but when results come on form, the numbers greater then 1000, comma r automaticaly inserted in it......how to remove these comma from numbers...

thx in Advance

I don't know how insistent you are on using whatever field you're using now, but one example of how you can display a number without the commas:

import javax.swing.*;
public class FormatField {

	public static void main(String[] args){
		JFrame frame = new JFrame();
		JPanel panel = new JPanel();
		frame.add(panel);
		JFormattedTextField field = new JFormattedTextField("");
		field.setText("100000");
		panel.add(field);
		frame.setSize(100,100);
		frame.setVisible(true);
	}
	
	
}

Of course, using this would mean using the Integer class's parseInt method and also converting any ints to Strings to show them in the field.

thanx for all..
i hav got it already ..it is that just pass 000 as format="000" where showing number field on jsp..problem is solved

I don't know how insistent you are on using whatever field you're using now, but one example of how you can display a number without the commas:

import javax.swing.*;
public class FormatField {

	public static void main(String[] args){
		JFrame frame = new JFrame();
		JPanel panel = new JPanel();
		frame.add(panel);
		JFormattedTextField field = new JFormattedTextField("");
		field.setText("100000");
		panel.add(field);
		frame.setSize(100,100);
		frame.setVisible(true);
	}
	
	
}

Of course, using this would mean using the Integer class's parseInt method and also converting any ints to Strings to show them in the field.

i m facing a another problem about date comparision on jsp

problem is that i m fetching date from database and i want to compair that date with current date before showing it on form...
it is some like that ...

<logic:lessEqual property="issueDate" value="<%=Calendar.getInstance().getTime().toString() %>" name="gatePassForm">
<td width="10%" class="ScreenData" align="center"><%=Calendar.getInstance().getTime().toString()%></td>
</logic:lessEqual>
<logic:greaterThan property="issueDate" value="<%=Calendar.getInstance().getTime().toString()%>" name="gatePassForm">
<td width="10%" class="ScreenData" align="center"><html:link page="/initialUpdateGatePass.do?method=initialUpdateScreen" paramName="itr" paramId="gatePassID" paramProperty="gatePassID"><html:img src="./web/images/edit.jpg" border="0" alt="Edit"/></html:link></td>
</logic:greaterThan>

but check failed due to date format both formats r deffrent....so help if u can

thanx for all..
i hav got it already ..it is that just pass 000 as format="000" where showing number field on jsp..problem is solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.