How to set Cursor in TextField?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.