How can i use loop "while" in GUI? : I have function
```java
public String namefunction(){while(true){
StringBuilder a = new StringBuilder();
do something
return a;
}}
```
And now i would like to create GUI and JButton. 

But i would like to get result from ```namefunction()``` after ONE LOOP after i click  this button. How can i do it?

```java
public void actionPerformed(ActionEvent e) {
		if (e.getSource().equals(myButton1)) {
tekst4.setText(namefunction());
}}
```