diff --git a/src/main/java/com/googlecode/lanterna/gui/component/Panel.java b/src/main/java/com/googlecode/lanterna/gui/component/Panel.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/googlecode/lanterna/gui/component/Panel.java
+++ b/src/main/java/com/googlecode/lanterna/gui/component/Panel.java
@@ -136,7 +136,10 @@ public class Panel extends AbstractContainer
     @Override
     public TerminalSize getPreferredSize()
     {        
-        return border.surroundAreaSize(layoutManager.getPreferredSize());
+        TerminalSize preferredSize = border.surroundAreaSize(layoutManager.getPreferredSize());
+        if(title.length() + 4 > preferredSize.getColumns())
+            preferredSize.setColumns(title.length() + 4);
+        return preferredSize;
     }
     
     @Override
Make the window larger if the title doesn't fit