1 package org.catacomb.druid.gui.base; 2 3 import java.awt.Dimension; 4 5 import org.catacomb.druid.swing.DScrollPane; 6 7 8 public class DruScrollingInfoPanel extends DruInfoPanel { 9 10 static final long serialVersionUID = 1001; 11 12 DScrollPane dsp; 13 14 15 public DruScrollingInfoPanel() { 16 this(""); 17 } 18 19 public DruScrollingInfoPanel(String text) { 20 this(text, 0, 0); 21 } 22 23 public DruScrollingInfoPanel(String text, int w, int h) { 24 super("", w, h); 25 setBorderLayout(2, 2); 26 getGUIPeer().setMinimumSize(new Dimension(50, 50)); 27 28 dsp = new DScrollPane(); 29 dsp.setVerticalScrollBarAlways(); 30 31 removeDComponent(htmlPane); 32 dsp.setViewportView(htmlPane); 33 addDComponent(dsp); 34 newTextAction = APPEND; 35 setTooltipTarget(htmlPane); 36 37 if (text != null) { 38 showInfo(text); 39 } 40 } 41 42 43 public void textAdded() { 44 dsp.scrollToBottom(); 45 } 46 47 }