Java Code Examples for javax.swing.JTabbedPane#setTabPlacement()
The following examples show how to use
javax.swing.JTabbedPane#setTabPlacement() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestDataComponent.java From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 | 6 votes |
private JTabbedPane createNewTestDataTab(TestData sTestData) { JTabbedPane testdataTab = new JTabbedPane(); testdataTab.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); testdataTab.setTabPlacement(JTabbedPane.BOTTOM); addToTab(testdataTab, sTestData.getGlobalData(), true); for (AbstractDataModel std : sTestData.getTestDataList()) { addToTab(testdataTab, std, false); } JLabel label = new JLabel("Click + to Add New TestData"); testdataTab.addTab("", ADD_NEW_TAB_ICON, label); label.setHorizontalAlignment(JLabel.CENTER); TabTitleEditListener l = new TabTitleEditListener(testdataTab, onTestDataRenameAction(), 0); l.setOnMiddleClickAction(onCloseAction()); testdataTab.addChangeListener(l); testdataTab.addMouseListener(l); testdataTab.addChangeListener(this); testdataTab.addMouseListener(onAddNewTDTab()); testdataTab.setComponentPopupMenu(testDataTabPopup); return testdataTab; }
Example 2
Source File: UIFactory.java From bigtable-sql with Apache License 2.0 | 6 votes |
public JTabbedPane createTabbedPane(int tabPlacement, boolean dndTabbedPane) { JTabbedPane pnl; if (dndTabbedPane) { pnl = new DnDSquirrelTabbedPane(_prefs, _app); } else { pnl = new SquirrelTabbedPane(_prefs, _app); } pnl.setTabPlacement(tabPlacement); fireTabbedPaneCreated(pnl); return pnl; }
Example 3
Source File: LogfileDialog.java From quickfix-messenger with BSD 3-Clause "New" or "Revised" License | 6 votes |
private void initComponents() { setLayout(new BorderLayout()); eventTextArea = new JTextArea(); messageTextArea = new JTextArea(); JScrollPane eventPane = new JScrollPane(eventTextArea); JScrollPane messagePane = new JScrollPane(messageTextArea); logTabPane = new JTabbedPane(); logTabPane.setPreferredSize(new Dimension(500, 500)); logTabPane.setTabPlacement(JTabbedPane.BOTTOM); logTabPane.addTab("Event", eventPane); logTabPane.addTab("Message", messagePane); add(logTabPane); pack(); }
Example 4
Source File: SyncSinkFrame.java From Panako with GNU Affero General Public License v3.0 | 4 votes |
public SyncSinkFrame(){ super("SyncSink"); logTextField = new JTextArea(); logTextField.setEditable(false); DefaultCaret caret = (DefaultCaret)logTextField.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); StringBuilder sb = new StringBuilder(); sb.append("----------------------------------------\n"); sb.append("Configuration currently in use: \n"); for(Key key : Key.values()){ sb.append("\t"); sb.append(key.name()); sb.append("="); sb.append(Config.get(key)); sb.append("\n"); } sb.append("----------------------------------------\n"); logTextField.setText(sb.toString()); this.setLayout(new BorderLayout()); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); cs = new CoordinateSystem(AxisUnit.OCCURENCES, 0, 1000); linkedPanel = new LinkedPanel(cs); linkedPanel.addLayer(new BackgroundLayer(cs)); linkedPanel.addLayer(new ZoomMouseListenerLayer()); linkedPanel.addLayer(new DragMouseListenerLayer(cs)); linkedPanel.addLayer(new BackgroundLayer(cs)); linkedPanel.addLayer(new TimeAxisLayer(cs)); linkedPanel.addLayer(new SelectionLayer(cs)); linkedPanel.getViewPort().addViewPortChangedListener(this); matches = new ArrayList<NFFTSyncMatch>(); this.streamLayers = new ArrayList<StreamLayer>(); this.streamFiles = new ArrayList<File>(); JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab("Timebox plot", null, linkedPanel,"Timebox plots"); tabbedPane.setMnemonicAt(0, KeyEvent.VK_1); tabbedPane.addTab("Messages", null, new JScrollPane(logTextField),"Logs messages"); tabbedPane.setMnemonicAt(1, KeyEvent.VK_2); tabbedPane.setTabPlacement(JTabbedPane.BOTTOM); tabbedPane.setBorder(new EmptyBorder(0,0,0,0)); this.add(tabbedPane,BorderLayout.CENTER); this.add(createStatusBarPanel(),BorderLayout.SOUTH); new FileDrop(null, tabbedPane, /*dragBorder,*/ new FileDrop.Listener(){ public void filesDropped( final File[] files ){ new Thread(new Runnable(){ @Override public void run() { for( int i = 0; i < files.length; i++) { final File fileToAdd = files[i]; logMessage("Adding " + fileToAdd.getPath() + "..."); openFile(fileToAdd,streamFiles.size()); logMessage("Added " + fileToAdd.getPath() + "."); } }},"File adding thread").start(); } }); }