Problem in java applet textfield :\?
-
heey everyone i actually had this very same problem once before and figured it out by my own but this time i can't remember what did i do hehehe the program is long but this one is short to just show the problem i wanna input numbers in input dialog messages then they should show in the textfields import java.io.*; import java.applet.*; import java.applet.Applet.*; import java.awt.*; import javax.swing.*; public class xx extends Applet { int a; TextField text; public void init(){ JOptionPane.showMessageDialog(null,"En… two numbers"); for (int i=0;i<2;i++){ String s=JOptionPane.showInputDialog("Enter please"); a = Integer.parseInt(s);} for (int i=0;i<2;i++){ TextField text= new TextField(10); add(text);} } public boolean action(Event op, Object gp){ for(int i=0;i<2;i++){ String n= text.getText(); a=Integer.parseInt(n); text.setText(n);} System.exit(0); return false;} } it works good but the numbers dont show in the textfields :S i think its in how i wrote the get and set text, can anyone help please? THANKS anyway
-
Answer:
Hi, Try change to ... text.setText(a);} ... and see if it work or not! Thank you, Bye.
palestin... at Yahoo! Answers Visit the source
Related Q & A:
- how to close the applet in java code?Best solution by Stack Overflow
- How to load an image to an applet?Best solution by stackoverflow.com
- Is it possible to run Oracle Forms without applet?Best solution by Stack Overflow
- How to create a java applet?Best solution by Stack Overflow
- Why am I having this problem with java or Windows Installer?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.