Hi,
U can use the JOptionPane class in javax.swing. It contains a static method called showInputDialog() which prompts the user to enter a string. on clicking the ok button the string is returned to the calling class.
The method signature is
public static String showInputDialog(Component parent,Object message)
Here is a sample piece of code to help u out
import javax.swing.*;
import java.awt.event.*;
public class Show extends JFrame implements ActionListener
{
JPanel p;
JButton b;
// constructor
public Show()
{
// set the bounds
setBounds(50,50,200,100);
setVisible(true);
getContentPane().setLayout(null);
// make the button and panel
p = new JPanel();
p.setBounds(0,0,200,100);
p.setLayout(null);
b = new JButton("Clickme"

;
b.setBounds(0,0,80,40);
b.addActionListener(this);
// add the button to the panel
p.add(b);
// add the panel to the contentpane
getContentPane().add(p);
}
public void actionPerformed(ActionEvent ae)
{
// when the button is clicked
if(ae.getSource().equals(b))
{
// show the input dialog
String s = JOptionPane.showInputDialog(this,"Enter ur text"

;
// im just showing the string u entered // u can call any method also here..
System.out.println(s);
}
}
public static void main(String args[])
{
Show show = new Show();
}
}
The graphics is not very elegant but itll solve ur purpose..
hope this helps
Reddy316