List of usage examples for javax.swing JTabbedPane getToolTipTextAt
public String getToolTipTextAt(int index)
index
. From source file:Main.java
public static void main(String[] argv) throws Exception { JTabbedPane pane = new JTabbedPane(); int count = pane.getTabCount(); for (int i = 0; i < count; i++) { String label = pane.getTitleAt(i); Icon icon = pane.getIconAt(i); String tooltip = pane.getToolTipTextAt(i); boolean enabled = pane.isEnabledAt(i); int keycode = pane.getMnemonicAt(i); Component comp = pane.getComponentAt(i); }//www. jav a 2 s. c o m }
From source file:Main.java
public static void main(String[] argv) throws Exception { JTabbedPane pane = new JTabbedPane(); String label = "Tab Label"; String tooltip = "Tool Tip Text"; pane.addTab(label, null, new JButton("Button"), tooltip); int index = pane.getTabCount() - 1; tooltip = pane.getToolTipTextAt(index); tooltip = "New Tool Tip Text"; pane.setToolTipTextAt(index, tooltip); }
From source file:Main.java
public static void main(String[] argv) throws Exception { JTabbedPane pane = new JTabbedPane(); int src = pane.getTabCount() - 1; int dst = 0;/* w ww . j av a 2 s . co m*/ Component comp = pane.getComponentAt(src); String label = pane.getTitleAt(src); Icon icon = pane.getIconAt(src); Icon iconDis = pane.getDisabledIconAt(src); String tooltip = pane.getToolTipTextAt(src); boolean enabled = pane.isEnabledAt(src); int keycode = pane.getMnemonicAt(src); int mnemonicLoc = pane.getDisplayedMnemonicIndexAt(src); Color fg = pane.getForegroundAt(src); Color bg = pane.getBackgroundAt(src); pane.remove(src); pane.insertTab(label, icon, comp, tooltip, dst); pane.setDisabledIconAt(dst, iconDis); pane.setEnabledAt(dst, enabled); pane.setMnemonicAt(dst, keycode); pane.setDisplayedMnemonicIndexAt(dst, mnemonicLoc); pane.setForegroundAt(dst, fg); pane.setBackgroundAt(dst, bg); }
From source file:org.ayound.js.debug.ui.DebugMainFrame.java
private Component createMainPane() { mainPane = new CloseableTabbedPane(); mainPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { // TODO Auto-generated method stub Object source = e.getSource(); if (source instanceof JTabbedPane) { JTabbedPane pane = (JTabbedPane) source; int index = pane.getSelectedIndex(); if (index > -1) { String tips = pane.getToolTipTextAt(index); DebugUIUtil.setCurrentFile(tips); }/*from w ww . j a v a 2 s.c om*/ } } }); BookMarkListenerManager.setListener(new IBookMarkListener() { public boolean beforeAddBookmark(int line) { // if (EngineManager.getEngine().canBreakLine( // DebugUIUtil.getCurrentFile(), line + 1)) { // BreakPointManager.addBreakPoint(DebugUIUtil // .getCurrentFile(), line); // return true; // } else { // return false; // } BreakPointManager.addBreakPoint(DebugUIUtil.getCurrentFile(), line); return true; } public boolean beforeRemoveBookmark(int line) { BreakPointManager.removeBreakPoint(DebugUIUtil.getCurrentFile(), line, true); return true; } }); return mainPane; }