1 2 22 23 package org.webdocwf.util.loader.wizard; 24 25 import java.awt.*; 26 import java.awt.event.*; 27 import javax.swing.*; 28 import javax.swing.event.*; 29 import java.util.*; 30 import java.net.URL ; 31 32 33 34 35 41 public class OctopusGeneratorHelpFrame extends JFrame{ 42 43 private OctopusHelpToolBar toolBar; 44 private OctopusHelpPane browserPane; 45 private OctopusHelpPane favoritesBrowserPane; 46 47 48 49 50 private StringBuffer help = new StringBuffer (); 51 52 55 public OctopusGeneratorHelpFrame() { 56 super("Help for Enhydra Octopus" ); 57 58 browserPane=new OctopusHelpPane(); 59 toolBar=new OctopusHelpToolBar(browserPane); 60 favoritesBrowserPane=new OctopusHelpPane(); 61 favoritesBrowserPane.addHyperlinkListener(toolBar); 62 63 JPanel leftPanel=new JPanel(); 64 leftPanel.setLayout(new BoxLayout(leftPanel,BoxLayout.Y_AXIS)); 65 JPanel buttonPanel=new JPanel(); 66 JButton button = new JButton("Close Help ..."); 67 button.setSize(new Dimension(100, 100)); 68 button.setVisible(true); 69 buttonPanel.add(button,BorderLayout.CENTER); 70 button.addActionListener(new ActionListener() { 71 public void actionPerformed(ActionEvent e) { 72 dispose(); 73 } 74 75 }); 76 77 leftPanel.add(favoritesBrowserPane); 78 leftPanel.add(buttonPanel); 79 80 toolBar.setVisible(true); 81 favoritesBrowserPane.goToURL(getClass().getResource("HelpPages/mainIndex.html")); 82 83 84 JSplitPane splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 85 new JScrollPane (leftPanel), 86 new JScrollPane (browserPane)); 87 splitPane.setDividerLocation(300); 88 splitPane.setOneTouchExpandable(true); 89 90 Container contentPane=getContentPane(); 91 contentPane.add(toolBar,BorderLayout.NORTH); 92 contentPane.add(splitPane,BorderLayout.CENTER); 93 94 Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); 95 setBounds(1,1,dimension.width-5, dimension.height-30); 96 97 } 98 } | Popular Tags |