When configuring a JDialog, there are times when you need to check the size of a JLabel.
Even if you set the text after creating a JLabel, its size is not set.
In this case, if you set the dialog panel and then call pack(), the size of the JLabel will be set and you can read the value.
Then, you can create the necessary UI using the read size value and set the panel again.
When a JLabel is placed next to another component, it is used to fit the window size.
No comments:
Post a Comment