|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjewl.Window
jewl.Container
jewl.TabbedPanel
A set of overlapped pages, each of which is a separate container for other windows. Each page has a tab at the top of the panel which displays the page's title. Clicking a tab with the mouse brings the corresponding page to the front. You can also use the left and right arrow keys on the keyboard to move between pages.
Each page acts as a separate container. When a window is added to a TabbedPanel, it is actually added to the currently-selected page.
A TabbedPanel will call any registered event listeners when a new page is selected.
| Constructor Summary | |
TabbedPanel(Container parent,
int left,
int top,
int width,
int height,
java.lang.String title)
Construct a tabbed panel with a single page. |
|
| Method Summary | |
int |
addPage(java.lang.String title)
Add a new page to the panel. |
int |
getBorderHeight()
Get the total height of the top and bottom borders of this panel. |
int |
getBorderWidth()
Get the total width of the left and right borders of this panel. |
Font |
getFont()
Get the current font used for the tabs in this panel. |
int |
getPage()
Get the index of currently-selected page. |
java.lang.String |
getTitle()
Get the title for the currently-selected page. |
java.lang.String |
getTitle(int page)
Get the title for a specified page. |
void |
selectPage(int page)
Select a specific page. |
void |
setFont(java.awt.Font font)
Set the font to be used for the tabs on this panel. |
void |
setTitle(int page,
java.lang.String title)
Set the title for a specified page. |
void |
setTitle(java.lang.String title)
Set the title for the currently-selected page. |
| Methods inherited from class jewl.Container |
getInteriorHeight, getInteriorWidth |
| Methods inherited from class jewl.Window |
addEventListener, commandAvailable, getCommand, getHeight, getID, getLeft, getScreenHeight, getScreenWidth, getSource, getTop, getWidth, hide, init, isVisible, nextCommand, parent, root, setID, setLocation, setSize, show, show |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TabbedPanel(Container parent,
int left,
int top,
int width,
int height,
java.lang.String title)
parent - the panel's parent window.left - the position of the left edge of the panel relative to its parent.
If this is negative, it is taken to be relative to the right edge
of the parent window. If the parent window is resized, the panel
will be moved to maintain the same relative position.top - the position of the top edge of the panel relative to its parent.
If this is negative, it is taken to be relative to the bottom edge
of the parent window. If the parent window is resized, the panel
will be moved to maintain the same relative position.width - the width of the panel. If this is zero or negative, it is taken
to be relative to the width of the parent window. If the parent
window is resized, the panel will be resized to maintain the same
relative width.height - the height of the panel. If this is zero or negative, it is taken
to be relative to the height of the parent window. If the parent
window is resized, the panel will be resized to maintain the same
relative height.title - the title for the panel's initial page.| Method Detail |
public int getBorderWidth()
getBorderWidth in class Containerpublic int getBorderHeight()
getBorderHeight in class Containerpublic int addPage(java.lang.String title)
title - the title of the new page.
public int getPage()
public void selectPage(int page)
page - the number of the required page.
java.lang.IllegalArgumentException - if there is no such tab.public java.lang.String getTitle(int page)
page - the number of the page.
java.lang.IllegalArgumentException - if the page number is invalid.public java.lang.String getTitle()
getTitle in class Container
public void setTitle(int page,
java.lang.String title)
page - the number of the page.title - the new title for the specified page.
java.lang.IllegalArgumentException - if the page number is invalid.public void setTitle(java.lang.String title)
setTitle in class Containertitle - the new title for the current page.public void setFont(java.awt.Font font)
setFont in class Windowfont - the desired font to be applied. If this is null, the parent
window's font will be used. Although this is specified as a
java.awt.Font, you can use
jewl.Font instead.Fontpublic Font getFont()
getFont in class Window
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||