File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes setting value as zero in Textbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setting value as zero in Textbox " Watch "setting value as zero in Textbox " New topic

setting value as zero in Textbox

Gokulakannan Vasu

Joined: Jan 11, 2011
Posts: 14
Hi...I have 4 text boxes,which should show value as '0' by default while display.I have two modes 'Insert' & 'Modify'.When i give insert mode,i can give values for that textboxes.when i select 'modify' i can edit the values.The thing is,i should get all my textbox value as '0' for insert mode and i should get values which i entered and stored for those text boxes when i select 'modify' mode;

1. 0 should be shown,when i select insert
2. Stored value should be shown when i selected modify

Code as follows:
// for insert mode
protected void insertThresholdDetail() {


protected void modifyThresholdDetail() {

How should i do this...please help me...!!!
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3064

So you should be having the Event Handlers for your Insert and Modify events? And if you have- then you can call these methods in the respective event handlers. If not, then you would have to create Event handlers and then go ahead. If you are using JButton- then look at ActionListener.

Also please wrap your code with code tags - UseCodeTags

Mohamed Sanaulla | My Blog
jQuery in Action, 2nd edition
subject: setting value as zero in Textbox
Similar Threads
JTextField : setText() is not working. getText() is working
get the ActionForm property value into a java variable from JSP
JSTL tags
how to take javascript array values in php form
JTextField : setText() is not working. getText() is working