Java Code Examples for javax.swing.JTabbedPane#setPreferredSize()
The following examples show how to use
javax.swing.JTabbedPane#setPreferredSize() .
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: DefaultSingleTargetProductDialog.java From snap-desktop with GNU General Public License v3.0 | 6 votes |
private void initForm() { form = new JTabbedPane(); //only add ioParametersPanel if there are input or target products if(ioParametersPanel.getTargetProductSelectorDisplay() || ioParametersPanel.getSourceProductSelectorList().size() > 0) { form.add("I/O Parameters", ioParametersPanel); } else { //if there is no ioParametersPanel, the size of the form could be too small form.setPreferredSize(new Dimension(400, 300)); } if (bindingContext.getPropertySet().getProperties().length > 0) { final PropertyPane parametersPane = new PropertyPane(bindingContext); final JPanel parametersPanel = parametersPane.createPanel(); parametersPanel.setBorder(new EmptyBorder(4, 4, 4, 4)); form.add("Processing Parameters", new JScrollPane(parametersPanel)); updateSourceProduct(); } }
Example 2
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 3
Source File: CGraphSettingsDialog.java From binnavi with Apache License 2.0 | 6 votes |
/** * Creates the tabbed pane that is used to display the individual settings tabs. * * @param isDefaultSettingsDialog True, to indicate that the settings dialog is a default settings * dialog. * @param isCallgraph True, to indicate that the settings dialog is used for call graphs. False, * otherwise. * * @return The created pane. */ private JTabbedPane createTabbedPane(final boolean isDefaultSettingsDialog, final boolean isCallgraph) { final JTabbedPane tab = new JTabbedPane(); addTab(tab, "Automatism", new CAutomatismPanel(m_settings, isDefaultSettingsDialog)); addTab(tab, "Edges", new CEdgePanel(m_settings)); addTab(tab, "Hierarchic", new CHierarchicPanel(m_settings)); addTab(tab, "Orthogonal", new COrthogonalPanel(m_settings)); addTab(tab, "Circular", new CCircularPanel(m_settings)); if (!isCallgraph) { addTab(tab, "Disassembly", new CDisassemblyPanel(m_settings)); } addTab(tab, "Controls", new CControlsPanel(m_settings)); addTab(tab, "Miscellaneous", new CMiscPanel(m_settings, !isDefaultSettingsDialog || isCallgraph)); tab.setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT)); return tab; }
Example 4
Source File: ProgressLog.java From stendhal with GNU General Public License v2.0 | 6 votes |
/** * Create a new ProgressLog. * * @param name name of the window */ ProgressLog(String name) { window = new JDialog(j2DClient.get().getMainFrame(), name); tabs = new JTabbedPane(); tabs.setPreferredSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); tabs.addChangeListener(new TabChangeListener()); WindowUtils.closeOnEscape(window); window.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); window.add(tabs); window.pack(); WindowUtils.watchFontSize(window); WindowUtils.trackLocation(window, "travel_log", true); WtWindowManager.getInstance().registerSettingChangeListener("ui.logfont", new SettingChangeAdapter("ui.logfont", FONT_NAME) { @Override public void changed(String newValue) { fontName = newValue; for (Page page : pages) { page.setFontName(newValue); } } }); }
Example 5
Source File: PreferencesFrame.java From Logisim with GNU General Public License v3.0 | 5 votes |
private PreferencesFrame() { setDefaultCloseOperation(HIDE_ON_CLOSE); setJMenuBar(new LogisimMenuBar(this, null)); panels = new OptionsPanel[] { new TemplateOptions(this), new IntlOptions(this), new WindowOptions(this), new LayoutOptions(this), new ExperimentalOptions(this), new ForkOptions(this), }; tabbedPane = new JTabbedPane(); int intlIndex = -1; for (int index = 0; index < panels.length; index++) { OptionsPanel panel = panels[index]; tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText()); if (panel instanceof IntlOptions) intlIndex = index; } JPanel buttonPanel = new JPanel(); buttonPanel.add(close); close.addActionListener(myListener); Container contents = getContentPane(); tabbedPane.setPreferredSize(new Dimension(400, 300)); setMinimumSize(new Dimension(420, 300)); contents.add(tabbedPane, BorderLayout.CENTER); contents.add(buttonPanel, BorderLayout.SOUTH); if (intlIndex >= 0) tabbedPane.setSelectedIndex(intlIndex); LocaleManager.addLocaleListener(myListener); myListener.localeChanged(); pack(); setLocationRelativeTo(null); }
Example 6
Source File: AlignmentDemo.java From COMP3204 with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public Component getComponent(int width, int height) throws IOException { // the main panel final JPanel base = new JPanel(); base.setPreferredSize(new Dimension(width, height)); base.setLayout(new GridBagLayout()); final JTabbedPane tabs = new JTabbedPane(); tabs.setPreferredSize(new Dimension(width, height)); final ShapeModelDataset<MBFImage> dataset = AMToolsSampleDataset.load(ImageUtilities.MBFIMAGE_READER); final Float[][] colours = RGBColour.randomColours(dataset.size()).toArray(new Float[dataset.size()][]); final List<PointList> points = dataset.getPointLists(); final PointListConnections connections = dataset.getConnections(); final ImageComponent unaligned = createShapes(width, height, points, connections, colours); final PointList mean = GeneralisedProcrustesAnalysis.alignPoints(points, 5, 10); for (final PointList pl : points) { pl.translate(width / 3, height / 3); pl.scaleCentroid(100); } final ImageComponent aligned = createShapes(width, height, points, connections, colours); final List<PointList> meanList = new ArrayList<PointList>(1); mean.translate(width / 3, height / 3); mean.scaleCentroid(100); meanList.add(mean); final ImageComponent meanComp = createShapes(width, height, meanList, connections, new Float[][] { RGBColour.WHITE }); tabs.addTab("Unaligned", unaligned); tabs.addTab("Aligned", aligned); tabs.addTab("Mean", meanComp); base.add(tabs); return base; }
Example 7
Source File: ProgramPanel.java From mpcmaid with GNU Lesser General Public License v2.1 | 5 votes |
/** * @return A Component that is also BindingCapable * * When we select another pad, call the setElement() method to * update the view */ private Component makeFiltersArea(Pad pad) { final JTabbedPane sliders = new JTabbedPane(); sliders.setFont(SMALL_FONT); sliders.setPreferredSize(new Dimension(200, 400)); for (int i = 0; i < profile.getFilterNumber(); i++) { sliders.addTab("Filter" + (i + 1), makePadArea(pad.getFilter(i))); } return sliders; }
Example 8
Source File: ProgramPanel.java From mpcmaid with GNU Lesser General Public License v2.1 | 5 votes |
private JTabbedPane makeSlidersArea() { final JTabbedPane sliders = new JTabbedPane(); sliders.setFont(SMALL_FONT); sliders.setPreferredSize(new Dimension(200, 400)); for (int i = 0; i < profile.getSliderNumber(); i++) { sliders.addTab("Slider" + (i + 1), makeSliderArea(pgm, i)); } return sliders; }
Example 9
Source File: BaseDialogImpl.java From azure-devops-intellij with MIT License | 5 votes |
/** * There is a default implementation here, but subclasses can override this if they don't need tabbed pages. */ @Override protected JComponent createCenterPanel() { tabPanel = new JTabbedPane(); tabPanel.setPreferredSize(new Dimension(JBUI.scale(500), JBUI.scale(600))); tabPanel.addChangeListener(new ChangeListener() { @Override public void stateChanged(final ChangeEvent e) { doTabChangedAction(); } }); return tabPanel; }
Example 10
Source File: OptionsFrame.java From Logisim with GNU General Public License v3.0 | 5 votes |
public OptionsFrame(Project project) { this.project = project; this.file = project.getLogisimFile(); file.addLibraryListener(myListener); setDefaultCloseOperation(HIDE_ON_CLOSE); setJMenuBar(new LogisimMenuBar(this, project)); panels = new OptionsPanel[] { new SimulateOptions(this), new ToolbarOptions(this), new MouseOptions(this), }; tabbedPane = new JTabbedPane(); for (int index = 0; index < panels.length; index++) { OptionsPanel panel = panels[index]; tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText()); } JPanel buttonPanel = new JPanel(); buttonPanel.add(revert); buttonPanel.add(close); revert.addActionListener(myListener); close.addActionListener(myListener); Container contents = getContentPane(); tabbedPane.setPreferredSize(new Dimension(450, 300)); contents.add(tabbedPane, BorderLayout.CENTER); contents.add(buttonPanel, BorderLayout.SOUTH); LocaleManager.addLocaleListener(myListener); myListener.localeChanged(); pack(); setLocationRelativeTo(null); }
Example 11
Source File: LogFrame.java From Logisim with GNU General Public License v3.0 | 5 votes |
public LogFrame(Project project) { this.project = project; this.windowManager = new WindowMenuManager(); project.addProjectListener(myListener); project.addLibraryListener(myListener); setDefaultCloseOperation(HIDE_ON_CLOSE); setJMenuBar(new LogisimMenuBar(this, project)); setSimulator(project.getSimulator(), project.getCircuitState()); panels = new LogPanel[] { new SelectionPanel(this), new ScrollPanel(this), new FilePanel(this), }; tabbedPane = new JTabbedPane(); for (int index = 0; index < panels.length; index++) { LogPanel panel = panels[index]; tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText()); } JPanel buttonPanel = new JPanel(); buttonPanel.add(clearLog); clearLog.addActionListener(myListener); Container contents = getContentPane(); tabbedPane.setPreferredSize(new Dimension(450, 300)); contents.add(tabbedPane, BorderLayout.CENTER); contents.add(buttonPanel, BorderLayout.SOUTH); LocaleManager.addLocaleListener(myListener); myListener.localeChanged(); pack(); setLocationRelativeTo(null); }
Example 12
Source File: DefaultContentPanel.java From opt4j with MIT License | 5 votes |
@Override public void startup() { setLayout(new BorderLayout()); final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPane.setOneTouchExpandable(true); splitPane.setResizeWeight(1.0); add(splitPane); modulesPanel.setPreferredSize(new Dimension(220, 200)); selectedPanel.setPreferredSize(new Dimension(350, 200)); JPanel top = new JPanel(new BorderLayout()); top.add(modulesPanel, BorderLayout.WEST); top.add(selectedPanel, BorderLayout.CENTER); JTabbedPane bottom = new JTabbedPane(); bottom.addTab("Tasks", Icons.getIcon(Icons.CONSOLE), tasksPanel); bottom.setPreferredSize(new Dimension(300, 160)); top.setMinimumSize(new Dimension(300, 80)); splitPane.add(top, JSplitPane.TOP); splitPane.add(bottom, JSplitPane.BOTTOM); modulesPanel.startup(); selectedPanel.startup(); tasksPanel.startup(); setVisible(true); }
Example 13
Source File: SwingComponents.java From triplea with GNU General Public License v3.0 | 4 votes |
public static JTabbedPane newJTabbedPaneWithFixedWidthTabs(final int width, final int height) { final JTabbedPane tabbedPane = new JTabbedPaneWithFixedWidthTabs(); tabbedPane.setPreferredSize(new Dimension(width, height)); return tabbedPane; }
Example 14
Source File: SwingComponents.java From triplea with GNU General Public License v3.0 | 4 votes |
public static JTabbedPane newJTabbedPane(final int width, final int height) { final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.setPreferredSize(new Dimension(width, height)); return tabbedPane; }
Example 15
Source File: ControlPanel.java From gepard with MIT License | 4 votes |
public ControlPanel(Controller ictrl) { // store controller ctrl = ictrl; // load substitution matrices from XML file try { substMatrices = SubstMatrixList.getInstance().getMatrixFiles(); } catch (Exception e) { ClientGlobals.errMessage("Could not open substitution matrix list. " + "The 'matrices/' subfolder seems to be corrupted"); System.exit(1); } // sequences panel JPanel localTab = generateLocalTab(); seqTabs = new JTabbedPane(); // add sequence panes seqTabs.addTab("Sequences", localTab); seqTabs.addChangeListener(this); // function panel JPanel functPanel = generateFunctionPanel(); // options panel JPanel plotOptTab = generatePlotOptTab(); JPanel miscTab = generateMiscTab(); dispTab = generateDispTab(); optTabs = new JTabbedPane(); optTabs.setFont(MAIN_FONT); // optTabs.setBorder(BorderFactory.createEmptyBorder()); optTabs.addTab("Plot", plotOptTab); optTabs.addTab("Misc", miscTab); optTabs.addTab("Display", dispTab); optTabs.setSelectedIndex(0); // create layout seqTabs.setAlignmentX(Component.LEFT_ALIGNMENT); optTabs.setAlignmentX(Component.LEFT_ALIGNMENT); btnGo.setAlignmentX(Component.LEFT_ALIGNMENT); functPanel.setAlignmentX(Component.LEFT_ALIGNMENT); JPanel fixedBox = new JPanel(); fixedBox.setLayout(new BoxLayout(fixedBox, BoxLayout.Y_AXIS)); // fixedBox.setLayout(new GridBagLayout()); fixedBox.add(Box.createRigidArea(new Dimension(0, 3))); fixedBox.add(seqTabs); fixedBox.add(Box.createRigidArea(new Dimension(0, 10))); fixedBox.add(functPanel); // fixedBox.add(Box.createRigidArea(new Dimension(0,10))); fixedBox.add(Box.createRigidArea(new Dimension(0, 10))); fixedBox.add(optTabs); seqTabs.setPreferredSize(new Dimension(1, SEQ_HEIGHT)); functPanel.setPreferredSize(new Dimension(1, FUNCT_HEIGHT)); optTabs.setPreferredSize(new Dimension(1, OPT_HEIGHT)); // dummy panel which pushes the go button to the bottom of the window JPanel panelQuit = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; c.weightx = 1; c.weighty = 1000; panelQuit.add(new JLabel(""), c); c.gridy++; c.weighty = 1; c.insets = new Insets(0, HOR_MARGIN + QUIT_BTN_HOR_MARGIN, BELOW_QUIT_BTN, HOR_MARGIN + QUIT_BTN_HOR_MARGIN); panelQuit.add(btnQuit = new JButton("Quit"), c); btnQuit.setPreferredSize(new Dimension(1, QUIT_BTN_HEIGHT)); setLayout(new BorderLayout()); add(fixedBox, BorderLayout.NORTH); add(panelQuit, BorderLayout.CENTER); btnQuit.addActionListener(this); // simple or advanced mode if (Config.getInstance().getIntVal("advanced", 0) == 1) switchMode(true); else switchMode(false); // help tooltips btnQuit.setToolTipText(HelpTexts.getInstance().getHelpText("quit")); // set initial parameters needreload = true; setDispTabEnabled(false); setNavigationEnabled(false); }
Example 16
Source File: QFixMessengerFrame.java From quickfix-messenger with BSD 3-Clause "New" or "Revised" License | 4 votes |
private void initLeftPanel() { leftPanel = new JPanel(); leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS)); // Sessions Panel sessionsList = new JList<Session>(); appVersionsComboBox = new JComboBox<String>( QFixMessengerConstants.FIXT_APP_VERSIONS); JPanel sessionsPanel = new JPanel(); sessionsPanel.setBorder(new TitledBorder("Current Sessions")); sessionsPanel.setLayout(new BorderLayout()); initSessionsList(); JScrollPane sessionsListScrollPane = new JScrollPane(sessionsList); sessionsListScrollPane.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, 120)); sessionsListScrollPane.setMaximumSize(sessionsListScrollPane .getPreferredSize()); initAppVersionsComboBox(); JPanel appVersionsPanel = new JPanel(); appVersionsPanel.setLayout(new GridLayout(2, 1)); appVersionsPanel.add(new JLabel("ApplVerID: ")); appVersionsPanel.add(appVersionsComboBox); sessionsPanel.add(sessionsListScrollPane, BorderLayout.CENTER); sessionsPanel.add(appVersionsPanel, BorderLayout.SOUTH); // Prevent resize sessionsPanel.setMinimumSize(sessionsPanel.getPreferredSize()); sessionsPanel.setMaximumSize(sessionsPanel.getPreferredSize()); // Messages Panel messagesList = new JList<Message>(); recentMessagesMap = new HashMap<>(); recentMessagesListModel = new DefaultListModel<Message>(); recentMessagesList = new JList<Message>(recentMessagesListModel); JPanel messagesPanel = new JPanel(); messagesPanel.setBorder(new TitledBorder("Available Messages")); messagesPanel.setLayout(new BoxLayout(messagesPanel, BoxLayout.Y_AXIS)); initMessagesList(); JScrollPane messagesListScrollPane = new JScrollPane(messagesList); messagesListScrollPane.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, 300)); JScrollPane recentMessagesListScrollPane = new JScrollPane( recentMessagesList); messagesTabPane = new JTabbedPane(); messagesTabPane.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, 300)); messagesTabPane.addTab("All", messagesListScrollPane); messagesTabPane.addTab("Recent", recentMessagesListScrollPane); messagesPanel.add(messagesTabPane); leftPanel.add(sessionsPanel); leftPanel.add(messagesPanel); add(leftPanel, BorderLayout.WEST); }
Example 17
Source File: Tree.java From TrakEM2 with GNU General Public License v3.0 | 4 votes |
private void createGUI() { this.frame = new JFrame("Nodes for " + Tree.this); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent we) { Tree.this.tndv = null; } }); final JTabbedPane tabs = new JTabbedPane(); tabs.setPreferredSize(new Dimension(500, 500)); tabs.add("All nodes", new JScrollPane(table_allnodes)); tabs.add("Branch nodes", new JScrollPane(table_branchnodes)); tabs.add("End nodes", new JScrollPane(table_endnodes)); final JTextField search = new JTextField(14); search.addKeyListener(new KeyAdapter() { @Override public void keyPressed(final KeyEvent ke) { if (ke.getKeyCode() == KeyEvent.VK_ENTER) { search(search.getText()); } } }); final JButton b = new JButton("Search"); b.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent ae) { search(search.getText()); } }); final JPanel pane = new JPanel(); final GridBagLayout gb = new GridBagLayout(); pane.setLayout(gb); final GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.weightx = 1; c.gridwidth = 1; c.anchor = GridBagConstraints.NORTH; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(4,10,5,2); gb.setConstraints(search, c); pane.add(search); c.gridx = 1; c.weightx = 0; c.fill = GridBagConstraints.NONE; c.insets = new Insets(4,0,5,10); gb.setConstraints(b, c); pane.add(b); c.gridx = 0; c.gridy = 1; c.gridwidth = 2; c.weighty = 1; c.fill = GridBagConstraints.BOTH; final JScrollPane scp = new JScrollPane(table_searchnodes); c.insets = new Insets(0,0,0,0); gb.setConstraints(scp, c); pane.add(scp); tabs.add("Search", pane); frame.getContentPane().add(tabs); frame.pack(); ij.gui.GUI.center(frame); frame.setVisible(true); }
Example 18
Source File: Merger.java From TrakEM2 with GNU General Public License v3.0 | 4 votes |
private static void makeGUI(final Project p1, final Project p2, HashSet<ZDisplayable> empty1, HashSet<ZDisplayable> empty2, HashMap<Displayable,List<Change>> matched, HashSet<ZDisplayable> unmatched1, HashSet<ZDisplayable> unmatched2) { final ArrayList<Row> rows = new ArrayList<Row>(); for (Map.Entry<Displayable,List<Change>> e : matched.entrySet()) { for (Change c : e.getValue()) { rows.add(new Row(c)); } if (e.getValue().size() > 1) { Utils.log("More than one assigned to " + e.getKey()); } } JTabbedPane tabs = new JTabbedPane(); final Table table = new Table(); tabs.addTab("Matched", new JScrollPane(table)); JTable tu1 = createTable(unmatched1, "Unmatched 1", p1, p2); JTable tu2 = createTable(unmatched2, "Unmatched 2", p1, p2); JTable tu3 = createTable(empty1, "Empty 1", p1, p2); JTable tu4 = createTable(empty2, "Empty 2", p1, p2); tabs.addTab("Unmatched 1", new JScrollPane(tu1)); tabs.addTab("Unmatched 2", new JScrollPane(tu2)); tabs.addTab("Empty 1", new JScrollPane(tu3)); tabs.addTab("Empty 2", new JScrollPane(tu4)); for (int i=0; i<tabs.getTabCount(); i++) { if (null == tabs.getTabComponentAt(i)) { Utils.log2("null at " + i); continue; } tabs.getTabComponentAt(i).setPreferredSize(new Dimension(1024, 768)); } String xml1 = new File(((FSLoader)p1.getLoader()).getProjectXMLPath()).getName(); String xml2 = new File(((FSLoader)p2.getLoader()).getProjectXMLPath()).getName(); JFrame frame = new JFrame("1: " + xml1 + " || 2: " + xml2); tabs.setPreferredSize(new Dimension(1024, 768)); frame.getContentPane().add(tabs); frame.pack(); frame.setVisible(true); // so the bullshit starts: any other way to set the model fails, because it tries to render it while setting it SwingUtilities.invokeLater(new Runnable() { public void run() { table.setModel(new Model(rows)); CustomCellRenderer cc = new CustomCellRenderer(); for (int i=0; i<Row.COLUMNS; i++) { table.setDefaultRenderer(table.getColumnClass(i), cc); } }}); }