1 26 package org.objectweb.util.browser.core.panel; 27 28 import javax.swing.BoxLayout ; 29 import javax.swing.JLabel ; 30 import javax.swing.JPanel ; 31 32 import java.awt.*; 33 34 import org.objectweb.util.browser.api.TreeView; 35 import org.objectweb.util.browser.api.Panel; 36 37 43 public class WhitePanel 44 implements Panel { 45 46 JPanel panel_; 47 48 51 public WhitePanel() { 52 this(""); 53 } 54 55 59 public WhitePanel(String message) { 60 panel_ = new JPanel (); 61 panel_.setBackground(Color.white); 62 panel_.setLayout(new BoxLayout (panel_, BoxLayout.Y_AXIS)); 63 panel_.add(new JLabel (message), BorderLayout.CENTER); 64 } 65 66 69 public void selected(TreeView treeView) { 70 Object o = treeView.getSelectedObject(); 71 if (o != null) 72 panel_.add(new JLabel (o.toString()), BorderLayout.CENTER); 73 } 74 75 79 public JPanel getPanel(){ 80 return panel_; 81 } 82 83 86 public void unselected(TreeView treeView) { 87 } 88 89 } 90 | Popular Tags |