This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

set button text dynamically  RSS feed

 
Sumi Festus
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.. I would like to know how to set the text on the button dynamically during runtime.. I tried using setLabel method but it is not working.. Is there another method i can use.. Thanks a lot...
--------------------------------------------------------------------------------
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setText()
 
Sumi Festus
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. Thanks.. I tried setText() but its is not working.. Its is just putting some junk text and not the string that i specify in the program.. What do i do
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to send you on over to the Swing/AWT forum to continue this. Joe's answer is the right one; if you're seeing garbage characters, it's an issue with international character-set setup in your OS, not so much a Java issue.
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sumi Festus:
What do i do


How about giving us some clue as to what you expect to see, what you are seeing and the code you are using. The kinds of things that are in our FAQ,
HowToAskQuestionsOnJavaRanch.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!