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
5
votes
2 answers

Android TextView setText overlays previous Text

I would like to set a Text into a TextView of my app(lication). This is the code I used: TextView lonTextView = (TextView) findViewById(R.id.textViewLonWert); lonTextView.setText(longitude.toString()); Actually it works, but the previous Text is…
zuluk
  • 1,557
  • 8
  • 29
  • 49
5
votes
2 answers

JTextArea/JTextComponent setText causes crash

I am new to Java in general and in particular with the Swing library. When I experimented with the Notepad demo (standard demo from JDK), I got a crash when trying to change text in the editor window. My sample code: void Filter(Component f){ if…
Darius
  • 180
  • 1
  • 13
5
votes
5 answers

Reference string resource from code

I have the following string declared in strings.xml: Your last click was on Now when someone clicks a button, I want a textview to show this string, with a space, then a variable value that is a…
scarhand
  • 4,269
  • 23
  • 63
  • 92
4
votes
1 answer

Android call setText within onTextChanged

To prevent the infinite loop I did something as ugly as this... @Override protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { String t = text.toString(); String tt = t.toUpperCase(); …
BlueWanderer
  • 2,671
  • 2
  • 21
  • 36
4
votes
2 answers

Memory leak when using setText

I have noticed that I have a memory leak in my program. I have traced the problem to the line. Clock.setText("" + h + ":" + df.format(m) + ":" + df.format(s)); I have googled this and it seems to be a common problem but I have not found an…
PAUL WHITE
  • 303
  • 1
  • 3
  • 9
4
votes
3 answers

Cannot set button text to "<<<"

I'm trying to set the text of a button to "<<<" from my xml but I get an "Error:(20) Error parsing XML: not well-formed (invalid token)"
4
votes
1 answer

TextView Crashes When Setting Text

For some reason my application crashes when I try to set the text of a textview? How can I over come this. private TextView strStatus; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { …
Dennis
  • 41
  • 2
4
votes
2 answers

Strange behaviour in Expandablelistview - Android

Im trying to implement an activity that uses ExpandableListView and I have gotten so far but now I have found some strange behavior. My activity is meant to record food intake as specified by the user. they have a choice of menus (breakfast, lunch…
4
votes
1 answer

Settext issue in ViewPager particular version - 5.1.1 android?

I am building android application where I am using Custom ViewPager. The Problem is explain below in the following steps: When I open new activity of ViewPager and click on any button and setText any particular value to it. It's working…
4
votes
2 answers

UiAutomator Android - setText method is not working.!

Now, I am trying for using UIAutomator. We create an application. When testing it, setText method of UIAutomator is not working. When click EditText, key board is appeared. And then set text to this object, but it is not worked. Here my code for…
R.Katnaan
  • 2,486
  • 4
  • 24
  • 36
4
votes
2 answers

label.setText NullPointerException

Hi first time here but here goes: I have a JavaFX application that changes the FXML UI labels dynamically and the data is pulled from a Player class. The two classes in question are Player.java and InterfaceHandler.java. The player class stores…
twin_suns
  • 43
  • 1
  • 1
  • 4
4
votes
1 answer

Why is setText() not working in the following code on the TextView?

// All required Imports public class PuzzleActivity extends Activity implements OnClickListener{ private PuzzlerDB db; private Puzzle puz; private int puzId=1; private String puzAns=""; private int score=0; private…
Dexter
  • 4,036
  • 3
  • 47
  • 55
4
votes
1 answer

How to set text for EditText control when its inputType is number

How to set text programmatically for EditText control when its inputType is number ?
Joy
  • 1,707
  • 7
  • 29
  • 44
4
votes
3 answers

Undo in JTextField and setText

JTextField has an undo support out of box. It works fine for user interacion, but unfortunately if method setText(String str) is called, that results two UndoableEdits instead of one. So this code looks and feels fine but does not work: UndoManager…
AvrDragon
  • 7,139
  • 4
  • 27
  • 42
4
votes
1 answer

Update label in another View Controller from the appDelegate

I would like to update a label in one of my ViewControllers from the appDelegate. The Label in the view controller is all linked up in IB and has properties set. In the AppDelegate .h I am creating an ivar for the view controller so I can access the…
Alex McPherson
  • 3,185
  • 3
  • 30
  • 41
1 2
3
52 53