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

Java Swing - set Jlabel text from another method

I'm pretty new to Java and Swing, and I'm using Windowbuilder to play around with a few GUI ideas I have, but I've run into a problem when trying to set the text of a Jlabel. Windowbuilder has automatically created an instance of the Jlabel, called…
Bagshot
  • 57
  • 1
  • 2
  • 7
2
votes
1 answer

JLabel.setText() method

So i was writing a program to solve a quadratic equation, and everything works apart from when it comes to making 2 JLabels (previously empty) show the answers, (this happens when the user clicks a JButton) Here is the whole program, because i…
Puff Pure
  • 75
  • 1
  • 9
2
votes
2 answers

JTextField's setText method doesn't work from a KeyListener

I'm puzzled as to why a JTextField doesn't seem to just "clear out" by using the setText("") method on it, when this is coming from a KeyListener. It works fine from an ActionListener, except that, most amazingly, if the KeyListener method tries to…
2
votes
1 answer

Android In App Purchase - Cannot call button setText() from onBillingSetupFinished() event

I have an In App Purchase feature where I think am following the standard process but getting challenged with a weird issue related to a Button setText() updates. Here is what I want to do: Start the billing connection On successful…
2
votes
0 answers

PyQt5 setText with a signal class

I'm trying to update QLineEdit() with setText. However, that is made through a signal thread class (A) that is able to send every time signal to a widget class (B) [deputy to change the text]. let see an example: classB(QWidget): def __init__(self,…
pippo87
  • 23
  • 3
2
votes
1 answer

text isn't showing after using setText() to TextView() in inflated layout

Yes, I know that similar questions were asked before but I tried many of those. So I have a problem with setting text in TextView in the inflated layout. I tried setContentView() then it works but then activity_main.xml with the menu isn't working.…
2
votes
1 answer

Pros/Cons of setting text with setText(R.string.value) and setText(getResources().getString(R.string.value)

I can set text by simply doing setText(R.string.value), for example. I receive no compile or runtime errors. I learned this by mistake, as I always use to set text by getting my string values from resources, such as…
portfoliobuilder
  • 7,556
  • 14
  • 76
  • 136
2
votes
2 answers

Android - Programming Style - RecyclerView - Use SetText in ViewHolder or in onBindViewHolder?

When setting OnClickListeners to items in the RecyclerView it's recommended to do that in the inner class like this: public ViewHolder(View itemView) { super(itemVIew); nameTextView = (TextView) itemView.findViewById(R.id.item_name); …
2
votes
1 answer

getting value from another package

I wanna get a value from "application" package and use it in "packet" package, but my way doesnt work. I want lblCal in "packet" package to have the same value as loppkcal or lblKcal has in "application" package. Im sorry if my code looks like…
kiq
  • 39
  • 4
2
votes
1 answer

textView inside bottoSheet doesn't change

I try to change textView text every time i click my marker. But the the textView doesn't change the text. The log shows the text but the setText doesn't work public boolean onMarkerClick(Marker marker) { Halte h =…
rrr ppp
  • 56
  • 1
  • 5
2
votes
1 answer

Android studio strange warning

I'm new to code in Android Studio and when i set a integer in a text like this: textview.setText(String.format("%d",1)); This code give me back a warning: Implicitly using the default locale is a common source of bugs: Use String.format…
GMX
  • 950
  • 1
  • 14
  • 29
2
votes
1 answer

Calling TextView.setText() periodically causes the UI to jerk

I'm coding an audio player where a thread updates the TextView representing the track's elapsed time, every 250 milliseconds. The display looks like this: 1:30/2:30<-----Progress Bar-----> TextView 1 is 1:30/ and TextView 2 is 2:30. Both are set to…
Sid
  • 9,508
  • 5
  • 39
  • 60
2
votes
1 answer

Android SetText in OkHttp Async callback causing crash

I have an android activity that executes an Asynchronous Okhttp call, when the activity is loaded ( called from the onStart method as getActiveRequests()). public class MainActivity extends AppCompatActivity implements View.OnClickListener { Button…
jjharrison
  • 841
  • 4
  • 19
  • 33
2
votes
1 answer

Condition with delay

I want to use a delay but inside have a condition. Anything like that. This method is the delay, inside when time is finish i call method responde(), but setText not work. public void pensar(View v){ respuesta.setText("Ummmm"); new…
Aris Guimerá
  • 1,095
  • 1
  • 12
  • 27
2
votes
0 answers

using setText() don't want to call textwatcher events?

i am using EditText. when i use setText(). TextWatcher Events are calling. i don't need to call it? can anyone help me? txt_qty.addTextChangedListener(new TextWatcher() { @Override public void…