Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to dynamically increase JDialog size in swing?

Tags:

java

swing

I have a JDialog and inside it am having a JLabel in which the contents are added dynamically. Initially I set the size of the JDialog and JLabel (both having same size), now if my contents in the JLabel exceeds the size of the JDialog, the content is not visible.

How can i dynamically change the size of the JDialog so that the size gets matched to the content with using layouts?

like image 385
harishtps Avatar asked Dec 01 '10 13:12

harishtps


1 Answers

Invoke pack after the jlabel content change.

like image 143
OscarRyz Avatar answered Sep 17 '22 18:09

OscarRyz