Reputation: 45
I can change the location of a JButton, but I can not change the title. Is it possible that the java file is corrupted? How come I can't change the title while changing the location? I use Eclipse...
Upvotes: 0
Views: 110
Reputation: 2129
The width of the button is too short to display the title (15 pixels). As a fallback, the …
is shown.
In addition, I highly recommend not to use the setBounds
method directly. Take a look at a Java Swing tutorial on Youtube, Vimeo, Udemy, or as a book. You will learn how to create a user interface with layout managers. You won't have these kinds of problems then.
You might want to consider learning JavaFX instead because Swing is end of life.
Upvotes: 1