当前位置: 首页>>代码示例>>Java>>正文


Java JTabbedPane.getTitleAt方法代码示例

本文整理汇总了Java中javax.swing.JTabbedPane.getTitleAt方法的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPane.getTitleAt方法的具体用法?Java JTabbedPane.getTitleAt怎么用?Java JTabbedPane.getTitleAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTabbedPane的用法示例。


在下文中一共展示了JTabbedPane.getTitleAt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectWindowTabSelected

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
 * Gets the currently selected tab as instance of ProjectWindowTab.
 * 
 * @return the tab selected
 */
private ProjectWindowTab getProjectWindowTabSelected() {

	ProjectWindowTab tabSelected = null;

	int selIndex = this.projectViewRightTabs.getSelectedIndex();
	if (selIndex > -1) {
		String tabTitle = this.projectViewRightTabs.getTitleAt(selIndex);
		tabSelected = getProjectWindowTab(tabTitle);
		if (tabSelected != null) {
			JTabbedPane subPane = tabSelected.getCompForChildComp();
			if (subPane != null) {
				int selSubIndex = subPane.getSelectedIndex();
				if (selSubIndex != -1) {
					tabTitle = subPane.getTitleAt(selSubIndex);
					tabSelected = getProjectWindowTab(tabTitle);
				}
			}
		}
	}
	return tabSelected;

}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:28,代码来源:ProjectWindow.java

示例2: deleteTestData

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void deleteTestData(Object source) {
    JTabbedPane tab = (JTabbedPane) source;
    TestDataTablePanel panel = getSelectedData();
    if (!panel.isGlobalData) {
        int index = tab.getSelectedIndex();
        String name = tab.getTitleAt(index);
        int option = JOptionPane.showConfirmDialog(null, "Are you sure want to delete the TestData [" + name + "]", "Delete TestData", JOptionPane.YES_NO_OPTION);
        if (option == JOptionPane.YES_OPTION) {
            Boolean flag = testDesign.getProject().getTestData()
                    .getTestDataFor(envTab.getTitleAt(envTab.getSelectedIndex()))
                    .deleteTestData(name);
            if (flag) {
                tab.setSelectedIndex(index - 1);
                tab.removeTabAt(index);
            } else {
                Notification.show("Couldn't Delete Testdata - '" + name + "'");
            }
        }
    }
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:21,代码来源:TestDataComponent.java

示例3: getItemText

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
protected static String getItemText(JTabbedPane tabbedPane, int index) {
    String titleAt = tabbedPane.getTitleAt(index);
    if (titleAt == null || "".equals(titleAt)) {
        return getTabNameFromIcon(tabbedPane, index);
    }
    return titleAt;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:8,代码来源:JTabbedPaneTabJavaElement.java

示例4: TabComponent

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
 * Constructor for TabComponent class.
 * 
 * @param pane
 *            {@link JTabbedPane} parent component.
 * @param observer
 *            Main JNotepadPP frame.
 * @param lp
 *            Localization provider.
 */
public TabComponent(JTabbedPane pane, JNotepadPP observer,
        ILocalizationProvider lp) {

    super(new FlowLayout(FlowLayout.LEFT, 0, 0));
    this.lp = lp;
    this.observer = observer;
    setOpaque(false);

    JLabel label = new JLabel() {
        private static final long serialVersionUID = 1L;

        public String getText() {
            int i = pane.indexOfTabComponent(TabComponent.this);
            if (i != -1) {
                this.revalidate();
                return pane.getTitleAt(i);

            }
            return "";
        }
    };

    ImageIcon image = new ImageIcon(this.getClass().getResource(
            "res/green.png"));
    picLabel = new JLabel(image);
    add(picLabel);
    add(label);

    picLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
    label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
    closeButton = new CloseTabButton(this);
    add(closeButton);

    setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
}
 
开发者ID:fgulan,项目名称:java-course,代码行数:46,代码来源:TabComponent.java

示例5: ButtonTabComponent

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public ButtonTabComponent(final JTabbedPane pane) {
    //unset default FlowLayout' gaps
    super(new FlowLayout(FlowLayout.LEFT, 0, 0));
    if (pane == null) {
        throw new NullPointerException("TabbedPane is null");
    }
    this.pane = pane;
    setOpaque(false);
    
    //make JLabel read titles from JTabbedPane
    JLabel label = new JLabel() {
        public String getText() {
            int i = pane.indexOfTabComponent(ButtonTabComponent.this);
            if (i != -1) {
                return pane.getTitleAt(i);
            }
            return null;
        }
    };
    
    add(label);
    //add more space between the label and the button
    label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
    //tab button
    JButton button = new TabButton();
    add(button);
    //add more space to the top of the component
    setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
}
 
开发者ID:BlidiWajdi,项目名称:Mujeed-Arabic-Prolog,代码行数:30,代码来源:ButtonTabComponent.java


注:本文中的javax.swing.JTabbedPane.getTitleAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。