What is the syntax for changing a text box value in Java using Eclipse and the Android SDK?
-
I'm writing a calculator app for android in Java for a school project. I'm using Eclipse along with the Android SDK. I have a separate xml layout file (main.xml). I'm familiar with programming in C# in Visual Studio and I have been told that Java is very similar. However this is sort of an independent study type class so I unfortunately don't have a book or any training with Java. I'm trying to edit the value of a text box but I'm unsure of the syntax and I've been searching online and can't find anything on it. I'm used to doing: myTextBox.text = "test"; in C# but that doesn't appear to work in Java. In my main.xml I have: android:id="@+id/dispPanel" android:layout_width="fill_parent" android:layout_height="75dp" android:inputType="numberDecimal" android:textSize="30dp" I had thought in my CalculatorActivity.java file I could just add: dispPanel.text = "22.0"; or something similar. So I guess my question is, what is the proper syntax in java to do this? Is there anything special that I need to do in order to make sure the compiler in Eclipse knows that I am talking about dispPanel in the main.xml file other than the code that Eclipse has generated within my CalculatorActivity.java file (as seen below): package calculator.namespace; import android.app.Activity; import android.os.Bundle; public class CalculatorActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } Do I need to add any libraries also? I know this is probably such a basic question but I'm pretty lost right now. Also if you know of any good sites for general java syntax it would be great if you could pass them on. Thank you so much for your help in advance.
-
Answer:
There is no available syntax for editing the text box value; sorry about that.... Good luck!
fawkesth... at Yahoo! Answers Visit the source
Related Q & A:
- How do I make a text box on Myspace?Best solution by Yahoo! Answers
- How to search for a particular string in a text file using java?Best solution by Stack Overflow
- How do you forward a text using the G1?Best solution by answers.yahoo.com
- Can I mail a small box in the mail box using post office?Best solution by Yahoo! Answers
- What's the HTML code for a scroll box on top of a picture?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.