Swing Builder how to remove a JLabel
Answered
I'm currently developing an Intellij plugin with a GUI. This GUI is built with the Swing UI Designer -> Build Form option. It has a JLabel and a JButton. I wanted to remove the JLabel from my form. So, I selected that label in the GUI Designer and hit 'Delete' on my keyboard.
However, it doesn't delete the JLabel. It just doesn't do anything. I've selected the label properly to my knowledge but it's still there. I've noticed this behavior as well for things like JFrames. I've tried to use the "Cut" option too.
So, my question is how can I remove a JLabel, and other components that struggle to be deleted, properly?
Please sign in to leave a comment.
Does https://youtrack.jetbrains.com/issue/IDEA-208856 look like your case?
If possible prepare and provide a small project sample. The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID)
Thank you!
Hi Egor,
Thanks for your reply! The issue seems somewhat similar. I've noticed that when the binding class to my form is a Kotlin file (for example FooBar.kt) the JLabel isn't deleted. However, when I convert it to a Java file (Foobar.java) I can successfully delete it.
Unfortunately, UI Designer doesn't work with Kotlin classes properly. Feel free to upvote/follow https://youtrack.jetbrains.com/issue/KTIJ-791