Questions tagged [settext]

The concept of assigning text to a UI element

The concept of assigning text to a UI element.

Does not specifically refer to a programming language-specific or library-specific API but the general concept.

793 questions
-1
votes
1 answer

iOS view controller data sharing setText 'delay'

I have 2 View Controller's, one of them has a string (e.g. "Text1 Text2") that when a button gets pressed it saves it to default user data: [[NSUserDefaults standardUserDefaults] setObject:textObject forKey:@"textObjectKey"]; This same button has a…
sp00ky
  • 151
  • 9
-1
votes
2 answers

Changing label text using ActionListener

I'm trying to make a program that allows me to change the text of a label when clicking different buttons, however regardless of what button I click the text of the label changes to the last line of actionPerformed. import java.awt.*; import…
-1
votes
2 answers

JLabel.setText is not updating the text, but getText() returns the new text?

I've got this big multiple class application, and i've got alogin system. So after a user logs in the text "Welcome, Guest" should update do "Welcome, username". My method "logininfo" is the one handling it and it uses the method setText(). You can…
-1
votes
2 answers

set text color get null pointed

i want set my textview become red color if the remain day is less than 3 day, but dnt knw why i get null pointed for the setText color code ERROR LINE I get remain.setTextColor(Color.RED); this line error public class assigmentActivity extends…
Wei Chi
  • 29
  • 1
  • 8
-1
votes
2 answers

Why setText won't output to string inside fragment?

After I c/p code to fragment, my function won't set the string inside the app. But it worked at first without fragment, and I can't find the problem. App runs normally, but it won't output setText string on screen, while string is visible with it…
-1
votes
1 answer

Setting text of TextView in android in a loop

i'm trying to set text of text view in a while loop as t = (TextView)findViewById(R.id.textView1); while(true) { t.setText(hr+":"+":"min+":"+sec); try{ Thread.sleep(1000); } …
Dhruvam Gupta
  • 482
  • 5
  • 10
-1
votes
2 answers

Change TextView with Intent (String)

I have a listview class.listview opening and a user can click any listview item. I wanna set the text on a xml. I have strings like st1-st2-st3. If I clicked any listview item, how can I get it to open the xml and set Textview1 for st1/@String ? my…
MacSTD
  • 7
  • 1
  • 9
-1
votes
1 answer

Android: TextView Causes app to crash

I've got a TextView that crashes the app when trying to setText. I'm not using the XML layout and have set a custom view to handle everything. Obviously the app crashes when the screen is touched after the app is initalized. @Override protected…
ahmadux
  • 2,667
  • 3
  • 17
  • 15
-1
votes
1 answer

TextView.setText does not always working?

I have 12 TextView on the screen, and If any of it is clicked then I change the text using TextView.setText(). It works fine most of time, but some times the new text just do not appear when I clicked some of the TextView. A empty TextView is…
rml
  • 803
  • 10
  • 14
-1
votes
1 answer

set text on focus EditText from Button

I have a few EditText's and one Button which will put string on EditText. The problem is, that I don't know how to do it to set text on focus EditText. When I'm on first EditText and press btn I want to set text on first EditText, and when focus…
waclab1807
  • 71
  • 5
-1
votes
1 answer

setText causes nullPointerException, very simple, but no idea (android)

I am new in android development and have spent couple of hours on this. (eclipse + adt) Here are some extra words so i can post this. Getting Null pointer exception while calling run_time.setText("t"); @Override protected void onCreate(Bundle…
-1
votes
1 answer

JButton style same as words in a text

I want to make a java application, that will contain some text. I want some of these words to act like buttons. My idea is to put all the text in a text panel and the words that I want to act like buttons to be buttons. But i cant get a button to…
Rareș Smeu
  • 95
  • 1
  • 11
-1
votes
2 answers

editText.setText is not called the second time the dialog is opened

I have couple of dialogs where the user can go back and forth. One of which is a custom dialog with an editText. I want the description editText to be always blank. I used description.setText(""); When I edit the description text to for…
BRDroid
  • 3,920
  • 8
  • 65
  • 143
-1
votes
3 answers

Is the most efficient way to constantly update a label on screen to simply change the label's text property?

Say I have to update a label 1000 times a minute. Completely change its string value. Am I best off making 1000 setText: calls per minute? Or is there a more efficient way? Perhaps doing away with labels completely?
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
-1
votes
3 answers

Android change every string color

I'd like to change the color of every word in the changing text. How can I do this? selected.setText( "ID".Color.RED + "data".Color.BLUE);
meklod400
  • 129
  • 1
  • 2
  • 12