1 18 19 package de.gulden.framework.amoda.environment.gui.component; 20 21 import java.awt.*; 22 import javax.swing.*; 23 24 30 public class PresentationPanel extends JPanel { 31 32 36 private JLabel imageLabel; 37 38 39 43 public PresentationPanel() { 44 initComponents(); 45 } 46 47 public PresentationPanel(ImageIcon image) { 48 this(); 49 if (image!=null) { 50 imageLabel.setIcon(image); 51 } 52 } 53 54 public PresentationPanel(ImageIcon image, JComponent component) { 55 this(image); 56 add(component, java.awt.BorderLayout.CENTER); 57 this.validate(); 59 } 60 61 public PresentationPanel(ImageIcon image, String html) { 62 this(image); 63 JEditorPane editorPane=new JEditorPane(); 64 editorPane.setEditable(false); 65 editorPane.setContentType("text/html"); 66 editorPane.setText(html); 67 JScrollPane scrollPane=new JScrollPane(); 68 scrollPane.setViewportView(editorPane); 69 add(scrollPane, java.awt.BorderLayout.CENTER); 70 editorPane.setCaretPosition(0); 71 this.validate(); 72 73 } 74 75 76 80 private void initComponents() { 81 imageLabel = new javax.swing.JLabel (); 83 84 setLayout(new java.awt.BorderLayout ()); 85 86 add(imageLabel, java.awt.BorderLayout.WEST); 87 } 88 89 } | Popular Tags |