Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

Low-level java gui Containers - special purpose - JSrollPane, JTabbedPane

JScrollPane - Holds textarea, list, (or large images in label) and adds scroll bars as necessary.
scr = new JScrollPane(textarea); Surrounds textarea with scrollbars as needed.
JTabbedPane - Display tabs to allow user to select one of many panels.
tp = new JTabbledPane(); Constructor. Creates new tabbed pane.
tp = new JTabbledPane(place); Constructor. placement is JTabbedPane.TOP (default), BOTTOM, LEFT, or RIGHT.
tp = new JTabbledPane(place, ovrfl); Constructor. ovrfl tells what to do if too many tabs: JTabbedPane.WRAP_TAB_LAYOUT or .SCROLL_TAB_LAYOUT.

tp.addTab(title, comp); Adds tab labelled with string title which displays comp (usually JPanel).

tp.addTab(title, icon, comp); Used string and icon for tab label.

No comments:

Post a Comment

Archives