NetBeans: How to select JLabel that resides inside JFrame?
I developed a small desktop application in Java. At some position in my UI I drag and drop a JLabel
from Palette to JFrame
. Later-on i remove its text by right click -> Edit Text. I did this because i am populating this label dynamically using setText()
method. Now i need to reposition this Label, for this i first have to select that label and then drag n dr开发者_StackOverflowop it to new location. But i am unable to do so because there is no text in that label and hence its not visible :(
Is there any way through which i select this label?
The easiest way is add a few spaces to a label instead of an empty string. You may also put a label inside a panel with layout like Flow or Grid (where you can set margin) and drag the panel instead. If you're using layout like Free Design, Absolute or Null, you may also manually rescale the label (selecting it through Inspector view).
精彩评论