// Note: setMaximumSize does not work, so we use setPreferredSize and check
// the number of entries ourself.
if (event.getSlot("content").size() > 6) {
// Speed up drawing. The html table won't change anyway.
JPanel panel = new CachedPanel();
ScrolledViewport viewPort = new ScrolledViewport(panel);
// More reasonable scrolling speed when using the mouse wheel
viewPort.setScrollingSpeed(SCROLLING_SPEED);
panel.add(label);
Dimension screenSize = GameScreen.get().getSize();
viewPort.getComponent().setPreferredSize(new Dimension(screenSize.width - 80, screenSize.height - 100));
add(viewPort.getComponent(), BorderLayout.CENTER);
} else {
add(label);
}
setVisible(true);