File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting value as zero in Textbox

 
Gokulakannan Vasu
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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() {

getMajorPctField().setText("0");
getCriticalPctField().setText("0");
getMajorPctNERField().setText("0");
getCriticalPctNERField().setText("0");
getMajorPctALOCField().setText("0");
getCriticalPctALOCField().setText("0");
getMajorPctNREField().setText("0");
getCriticalPctNREField().setText("0");
}


protected void modifyThresholdDetail() {
getCriticalPctNERField().setText(""+detailedThreshold.getCriticalPctNER());
getMajorPctALOCField().setText(""+detailedThreshold.getMajorPctALOC());
getCriticalPctALOCField().setText(""+detailedThreshold.getCriticalPctALOC());
getMajorPctField().setText(""+detailedThreshold.getMajorPct());
getCriticalPctField().setText(""+detailedThreshold.getCriticalPct());
getMajorPctNREField().setText("0"+detailedThreshold.getMajorPctNRE());
getCriticalPctNREField().setText("0"+detailedThreshold.getCriticalPctNRE());
}


How should i do this...please help me...!!!
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic