private void initGUI() { setLayout(new MigLayout("fill,wrap 2", "[right,grow][grow]", "[][][][][][grow]")); add(new JLabel("Airspy Tuner"), "span,align center"); mFrequencyControl = new JFrequencyControl(); mFrequencyControl.addListener(this); /* Add frequency control as frequency change listener. This creates a * feedback loop, so the control does not rebroadcast the event */ mTuner.addListener(mFrequencyControl); mFrequencyControl.setFrequency(mController.getFrequency(), false); add(mFrequencyControl, "span,align center"); JideTabbedPane tabs = new JideTabbedPane(); tabs.setFont(this.getFont()); tabs.setForeground(Color.BLACK); add(tabs, "span,grow,push"); tabs.add("Config", new AirspyTunerConfigurationPanel(mResourceManager, mTuner.getController())); tabs.add("Info", new AirspyInformationPanel(mTuner.getController())); }
@Override protected void done() { try { String result = get(); if (result != null) { JOptionPane.showMessageDialog( mainPanel, result, "Error opening file", JOptionPane.ERROR_MESSAGE); } else { JideTabbedPane tabbedPane = mainPanel.getTabbedPane(); if (tabbedPane != null) { if (contentPanel != null) { // Already opened! tabbedPane.setSelectedComponent(contentPanel); } else { FolderDiffPanel panel = new FolderDiffPanel(mainPanel, diff); panel.setId(contentId); tabbedPane.addTab(panel.getTitle(), ImageUtil.getSmallImageIcon("stock_folder"), panel); tabbedPane.setSelectedComponent(panel); } } } } catch (Exception ex) { ex.printStackTrace(); } }
private JideTabbedPane createTabbedPane(Demo demo) { _pane = new JideTabbedPane(); _demoPanel = demo.getDemoPanel(); _pane.addTab("Demo", new JideScrollPane(new DemoPanel(_demoPanel))); _pane.setTabShape(JideTabbedPane.SHAPE_BOX); _pane.setHideOneTab(true); _pane.setFocusable(false); _pane.setTabPlacement(JideTabbedPane.TOP); return _pane; }
public void browseSourceCode() { if (_pane.getTabCount() == 1) { _pane.addTab("Source", AbstractDemo.createSourceCodePanel(_demo.getDemoSource())); } _pane.setSelectedIndex(1); }