// create components and panels
this.view = new JPanel(new BorderLayout());
this.tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
this.view.add(this.tabs, BorderLayout.CENTER);
// ctrl-tab and ctrl-shift-tab
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() {
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_TAB && e.isControlDown()) {
int tabcount = Desktop.this.tabs.getTabCount();
if (tabcount > 0) {
int sel = Desktop.this.tabs.getSelectedIndex();