1 26 27 package org.objectweb.util.browser.core.common; 28 29 30 import org.objectweb.util.browser.core.api.ViewPanel; 31 import org.objectweb.util.browser.core.panel.WhitePanel; 32 import org.objectweb.util.browser.api.Panel; 33 34 35 import java.awt.GridLayout ; 36 import java.awt.Dimension ; 37 38 import javax.swing.JPanel ; 39 import javax.swing.JScrollPane ; 40 41 48 public class DefaultViewPanel 49 extends JPanel 50 implements ViewPanel { 51 52 protected Panel panel_ = null; 53 54 57 public DefaultViewPanel() { 58 setLayout(new GridLayout (1, 0)); 59 setPreferredSize(new Dimension (400, 500)); 60 add(new JScrollPane ((new WhitePanel()).getPanel())); 61 } 62 63 66 public void setViewPanel(Panel newPanel) { 67 removeAll(); 68 panel_ = newPanel; 69 add(new JScrollPane (panel_.getPanel())); 73 revalidate(); 74 } 75 76 80 public Panel getViewPanel(){ 81 return panel_; 82 } 83 84 } 85 | Popular Tags |