📄 tabnamepanel.java
字号:
package com.magelang.tabsplitter;
/** This is a generic implementation of a TabNamedComponent. It can be used instead of
* a Panel as a component in a TabSplitter, giving you an easy place to set the
* tab text for the tab.
*
* <p>Use this code at your own risk! MageLang Institute is not
* responsible for any damage caused directly or indirectly through
* use of this code.
* <p><p>
* <b>SOFTWARE RIGHTS</b>
* <p>
* TabSplitter, version 2.0, Scott Stanchfield, MageLang Institute
* <p>
* We reserve no legal rights to this code--it is fully in the
* public domain. An individual or company may do whatever
* they wish with source code distributed with it, including
* including the incorporation of it into commerical software.
*
* <p>However, this code <i>cannot</i> be sold as a standalone product.
* <p>
* We encourage users to develop software with this code. However,
* we do ask that credit is given to us for developing it
* By "credit", we mean that if you use these components or
* incorporate any source code into one of your programs
* (commercial product, research project, or otherwise) that
* you acknowledge this fact somewhere in the documentation,
* research report, etc... If you like these components and have
* developed a nice tool with the output, please mention that
* you developed it using these components. In addition, we ask that
* the headers remain intact in our source code. As long as these
* guidelines are kept, we expect to continue enhancing this
* system and expect to make other tools available as they are
* completed.
* <p>
* The MageLang Support Classes Gang:
* @version TabSplitter 2.0, MageLang Insitute, Jan 18, 1998
* @author <a href="http:www.scruz.net/~thetick">Scott Stanchfield</a>, <a href=http://www.MageLang.com>MageLang Institute</a>
*/
import java.awt.Panel;
import java.awt.LayoutManager;
public class TabNamePanel extends Panel implements TabNamedComponent {
String tabName; // the name for the tab
/** default constructor */
public TabNamePanel() {
super();
}
/** layout constructor */
public TabNamePanel(LayoutManager layout) {
super(layout);
}
/** Constructor with a tab name */
public TabNamePanel(String tabName) {
super();
setTabName(tabName);
}
/** Constructor with a tab name */
public TabNamePanel(String tabName, LayoutManager layout) {
super(layout);
setTabName(tabName);
}
/** get the name to display on the tab */
public String getTabName() {
return tabName;
}
/** set the name to display on the tab */
public void setTabName(String tabName) {
this.tabName = tabName;
}
/** get a simple string represenation */
public String toString() {
return getClass().getName()+" [\""+tabName+"\"]";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -