0

So the problem I'm having at the moment is that I need to put text from a JTextField into a JList whenever I clicked a JButton. But how do I do this?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1
    Please read [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and edit your question accordingly. – isAif Jun 18 '20 at 16:19
  • 1
    Read the section from the Swing tutorial on [How to Use Lists](https://docs.oracle.com/javase/tutorial/uiswing/components/list.html). The `ListDemo` shows you how to dynamically update the ListModel with text from a text field when a button is clicked. It also shows you how to remove an item from the ListModel. – camickr Jun 18 '20 at 22:38

0 Answers0