how to dynamically increase JDialog size in 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?

Answers


Invoke pack after the jlabel content change.


Need Your Help

Unit testing MFC UI applications?

c++ unit-testing user-interface mfc tdd

How do you unit test a large MFC UI application?

How to reference a file in Eclipse that is not in src

java eclipse path

I'm trying to get a resource for MyBatis. The tutorial states that I will need the following in my Connection Factory:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.