What I want to do is when I input something in JOptionPane, say, APPLES. I want to display it as APPLES in the JFrame. Now, if I want to input CATS next, it’ll appear in the JFrame together with the APPLES.
It should look like this: APPLES CATS
And when I input more, it just displays and displays. The only way I know how to do it is to use setText for JLabel, but it’s only displaying ONE word. How do I display ALL of the words I input?
Hoping that you are getting word written in JOptionPane in JFrame, try this:
Here
strGotFromJOptionPaneis the text you got from JOptionPane.