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
3
votes
3 answers

Android Edittext: Get LineCount in an Activity's onCreate()

How can I do getLineCount() of an Edittext in the onCreate() method of an activity, having changed the Edittext's text, like the following: @override public void onCreate(Bundle savedInstanceState){ myEditText.setText("EXAMPLE"); …
Henry Thompson
  • 2,441
  • 3
  • 23
  • 31
3
votes
6 answers

Android Eclipse editText not displaying after setText on local instance

I call on a few EditTexts via "instanceOf" because I don't necessarily know the exact names / ids of them. When I do this to get the text, it works just fine. But when I try to setText() based on the local instanceOf EditText, it won't display…
Nick
  • 33
  • 1
  • 5
3
votes
3 answers

how to set new text in JTextField after creation?

I have a jTextField , and I set it's value to a certain sum when I create the frame. Here is the initiation code: totalTextField.setText( itemsPriceTextField.getText() + …
Daniel Briskman
  • 399
  • 2
  • 3
  • 11
3
votes
3 answers

Issues setting my textView via MainActivity.java

I am trying to set text in my MainActivity.java, but the text fails to appear in emulator. My activity_main.xml >
3
votes
3 answers

textView.setText(); crashes

The setText() method returns null in my application why? public class GetValue extends Activity { char letter = 'g'; int ascii = letter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle…
jonas
  • 33
  • 1
  • 1
  • 4
3
votes
2 answers

Why does TextView.setText() warn you not to concatenate strings?

If I do something like this someTextView.setText(someString + " and more!"); it warns me "Do not concatenate text displayed with setText. Use resource string with placeholders." Why does it warn this when string concatenation seems to work just…
user7085962
  • 449
  • 1
  • 5
  • 8
3
votes
1 answer

Adjust text size to fit button in Android

I have a number of buttons in a LinearLayout. The buttons have 1 weight, so they are placed evenly into the layout. I want to do something like this for (int i = 0; i < texts.size(); ++i) { Button button = new Button(/*context*/); …
sasha199568
  • 1,143
  • 1
  • 11
  • 33
3
votes
1 answer

setText not working for a Custom Edittext

I am using a nice Material design edit text which I found from github: https://github.com/rengwuxian/MaterialEditText and updated the dependency section as : dependencies { compile 'com.rengwuxian.materialedittext:library:2.0.3' } The edittext…
Aman Deep Gautam
  • 8,091
  • 21
  • 74
  • 130
3
votes
1 answer

TextView not showing up on Android device?

I have a few views in a Linear Layout. After clicking a button, some math is done. The result is then displayed in a textview. It works fine on the emulator, but it does not on my Android device. Entire Layout file:
Akutow
  • 33
  • 6
3
votes
1 answer

Update TextView in Custom Notification Layout

I made a custom layout for a foreground service with notification (obviously) that includes some TextViews. At some point the TextView's text needs to be changed, so I've been using setText method to do so. The problem is: nothing happens, it…
user3705007
  • 265
  • 4
  • 12
3
votes
1 answer

How can a textfield from fxml file be updated by setText in java file?

I am looking to update text in a textfield based on some value. In order to make this sample simpler I have made my program smaller. The problem seems to be when I put top.setText("This is my new Text"); I looked at this: how to change the text of…
eckama
  • 159
  • 2
  • 3
  • 11
3
votes
0 answers

Is it possible to highlight text in TextView without re - setText() completely?

For instance, I want to make a karaoke in a huge-huge text in a TextView. I got an array of milliseconds and with MediaPlayer's getCurrentTime() I need to highlight words corresponding to this array. The problem is if I do the refreshing with…
Vlad Alexeev
  • 2,072
  • 6
  • 29
  • 59
3
votes
1 answer

Android TextView Memory Leakage

I am developing a Music Application, in which a Seekbar is being used. I have one method which handles the seekbar performance, and which works well. but if seekbar is in action there is a memory leakage and the Log cat shows like GC_CONCURRENT…
Arundas K V
  • 801
  • 2
  • 14
  • 28
3
votes
1 answer

Trouble Adding text to JTextArea (append or settext)

So the program I am making uses 2 threads: One for the GUI and one to do the work. I want updates from the work thread/class to print out on JTextArea in GUI class. Everything I tried didn't seem to work. I added lines to print out text on the…
Emm
  • 51
  • 1
  • 6
3
votes
1 answer

Click "send" settext from text field to textarea

Hope someone could give me a wee bit of advice. I am really new to Java (1-2 weeks) and have been using tutorials to get this far but nothing I try allows me to do a (simple) task. When I click the button send in my GUI, I want it to set text/add…
Thomas__
  • 320
  • 3
  • 13