Java--I'm putting together a GUI interface for homework. What component do I use to make this text box? [pic]?

StackOverflow https://stackoverflow.com/questions/22947529

  •  30-06-2023
  •  | 
  •  

http://i.imgur.com/ibxDyW5.png

The picture is the example provided. I'm assuming when I slide the slider the text in the grey box will change based on the action listener's logic. I know how to do this, I just don't know what the grey box is called to initialize it. Is that a JTextField?

有帮助吗?

解决方案

That is a JTextField but is read-only. field.setEditable(false); is what you want to use after you have initialized the JTextField. See here for an example.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top