public void total ( String output)
{
choice = output
}
public String start()
{
return choice;
}
Then in the other class that calls it
class name is total part JPanel name is part1
private totalpart part1 = new totalpart();
private String finish;
private JTextfield panel = new JTextField(9);
public void init()
{
finish = totalpart.start();
panel.setText(finish);