KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > rero > dialogs > help > HelperObject


1 package rero.dialogs.help;
2
3 import javax.swing.*;
4 import javax.swing.border.*;
5
6 import java.awt.*;
7
8 import java.util.*;
9
10 import rero.dialogs.HelpWindow;
11
12 public abstract class HelperObject
13 {
14    public abstract JComponent getNavigationComponent();
15
16    protected HelpWindow help;
17
18    public JComponent getNavigation()
19    {
20       JPanel general = new JPanel();
21       general.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
22
23       general.setLayout(new BorderLayout(5, 5));
24
25       JScrollPane genScroller = new JScrollPane(getNavigationComponent());
26       genScroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
27
28       general.add(new JLabel("Contents:"), BorderLayout.NORTH);
29       general.add(genScroller, BorderLayout.CENTER);
30
31       return general;
32    }
33
34    public void setHelp(HelpWindow _help)
35    {
36       help = _help;
37    }
38
39    public void updateText(String JavaDoc newText)
40    {
41       help.updateText(newText);
42    }
43 }
44
Popular Tags