The Artima Developer Community
Sponsored Link

Java Answers Forum
Please consult a student on his simple work

1 reply on 1 page. Most recent reply: Jan 2, 2004 2:57 AM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Algis

Posts: 1
Nickname: aajus
Registered: Jan, 2004

Please consult a student on his simple work Posted: Jan 1, 2004 9:32 AM
Reply to this message Reply
Advertisement
I want a TextField to display a value of char variable. But it look like I must to move that value to string variable first. And a secont thing I don't know how to make a TextField to display a value of variable, not just a named text in the quotation-marks. When I try to discribe my TextField in one place, the variable is unknown. In another place I can't add the TextField to container. In line "add(tf);) an "add" gets marked red :(


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Posted: Jan 2, 2004 2:57 AM
Reply to this message Reply
Should read APIs along with work ...

>>>>But it look like I must to move that value to string variable first

setText method takes only String. so u are correct.Conver the char to String.(not too difficult...isnt it...Goood boy :-) )
http://java.sun.com/j2se/1.3/docs/api/java/awt/TextField.html#setText(java.lang.String)

>>>And a secont thing I don't know how to make a TextField to display a value of variable, not just a named text in the quotation-marks

What u are doing and what u want to do?? a code snippet might help us to understand...

and check where u are declaring ur textfield and where u are adding it to container.

Like in init() method (just for example)

if u have

TextField tf = new TextField();

Then use...

ur container.add(tf); will work in init method only.

Flat View: This topic has 1 reply on 1 page
Topic: need help Previous Topic   Next Topic Topic: phase coding

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use