當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。