List of usage examples for javax.swing JTabbedPane JTabbedPane
public JTabbedPane()
TabbedPane
with a default tab placement of JTabbedPane.TOP
. From source file:org.zaproxy.zap.extension.fuzz.httpfuzzer.ui.HttpFuzzResultsContentPanel.java
public HttpFuzzResultsContentPanel() { super(new BorderLayout()); tabbedPane = new JTabbedPane(); toolbar = new JToolBar(); toolbar.setFloatable(false);/*from w w w . java 2 s. com*/ toolbar.setRollover(true); messageCountLabel = new JLabel(Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.messagesSent")); messageCountValueLabel = new JLabel("0"); errorCountLabel = new JLabel(Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.errors")); errorCountValueLabel = new JLabel("0"); showErrorsToggleButton = new ZapToggleButton( Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.button.showErrors.label")); showErrorsToggleButton.setEnabled(false); showErrorsToggleButton.setToolTipText( Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.button.showErrors.tooltip")); showErrorsToggleButton.setSelectedToolTipText( Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.button.showErrors.tooltip.selected")); showErrorsToggleButton.setDisabledToolTipText( Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.button.showErrors.tooltip.disabled")); showErrorsToggleButton .setIcon(new ImageIcon(HttpFuzzResultsContentPanel.class.getResource("/resource/icon/16/050.png"))); showErrorsToggleButton.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (ItemEvent.SELECTED == e.getStateChange()) { showTabs(); } else { hideErrorsTab(); } } }); toolbar.add(Box.createHorizontalStrut(4)); toolbar.add(messageCountLabel); toolbar.add(Box.createHorizontalStrut(4)); toolbar.add(messageCountValueLabel); toolbar.add(Box.createHorizontalStrut(32)); toolbar.add(errorCountLabel); toolbar.add(Box.createHorizontalStrut(4)); toolbar.add(errorCountValueLabel); toolbar.add(Box.createHorizontalStrut(16)); toolbar.add(showErrorsToggleButton); JButton button = new JButton(Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.button.export")); button.setIcon(new ImageIcon(HttpFuzzResultsContentPanel.class.getResource("/resource/icon/16/115.png"))); button.addActionListener((new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { WritableFileChooser chooser = new WritableFileChooser( Model.getSingleton().getOptionsParam().getUserDirectory()) { private static final long serialVersionUID = -1660943014924270012L; @Override public void approveSelection() { File file = getSelectedFile(); if (file != null) { String filePath = file.getAbsolutePath(); if (!filePath.toLowerCase(Locale.ROOT).endsWith(CSV_EXTENSION)) { setSelectedFile(new File(filePath + CSV_EXTENSION)); } } super.approveSelection(); } }; chooser.setSelectedFile(new File( Constant.messages.getString("fuzz.httpfuzzer.results.toolbar.button.export.defaultName"))); if (chooser .showSaveDialog(View.getSingleton().getMainFrame()) == WritableFileChooser.APPROVE_OPTION) { boolean success = true; try (CSVPrinter pw = new CSVPrinter( Files.newBufferedWriter(chooser.getSelectedFile().toPath(), StandardCharsets.UTF_8), CSVFormat.DEFAULT)) { pw.printRecord(currentFuzzer.getMessagesModel().getHeaders()); int count = currentFuzzer.getMessagesModel().getRowCount(); for (int i = 0; i < count; i++) { List<Object> valueOfRow = currentFuzzer.getMessagesModel().getEntry(i) .getValuesOfHeaders(); String customStateValue = fuzzResultTable.getCustomStateValue( currentFuzzer.getMessagesModel().getEntry(i).getCustomStates()); valueOfRow.add(13, customStateValue); pw.printRecord(valueOfRow); } } catch (Exception ex) { success = false; JOptionPane.showMessageDialog(View.getSingleton().getMainFrame(), Constant.messages .getString("fuzz.httpfuzzer.results.toolbar.button.export.showMessageError") + "\n" + ex.getLocalizedMessage()); logger.error("Export Failed: " + ex); } // Delay the presentation of success message, to ensure all the data was // already flushed. if (success) { JOptionPane.showMessageDialog(View.getSingleton().getMainFrame(), Constant.messages .getString("fuzz.httpfuzzer.results.toolbar.button.export.showMessageSuccessful")); } } } })); toolbar.add(Box.createHorizontalGlue()); toolbar.add(button); mainPanel = new JPanel(new BorderLayout()); fuzzResultTable = new HttpFuzzerResultsTable(RESULTS_PANEL_NAME, EMPTY_RESULTS_MODEL); errorsTable = new HttpFuzzerErrorsTable(ERRORS_PANEL_NAME, EMPTY_ERRORS_MODEL); fuzzResultTableScrollPane = new JScrollPane(); fuzzResultTableScrollPane.setViewportView(fuzzResultTable); errorsTableScrollPane = new JScrollPane(); errorsTableScrollPane.setViewportView(errorsTable); mainPanel.add(fuzzResultTableScrollPane); add(toolbar, BorderLayout.PAGE_START); add(mainPanel, BorderLayout.CENTER); }
From source file:pcgen.gui2.dialog.AboutDialog.java
/** * This method is called from within the constructor to * initialize the form./*from www. j av a 2 s . c o m*/ */ private void initComponents() { JTabbedPane mainPane = new JTabbedPane(); mainPane.add(LanguageBundle.getString("in_abt_credits"), buildCreditsPanel()); //$NON-NLS-1$ mainPane.add(LanguageBundle.getString("in_abt_libraries"), buildIncludesPanel()); //$NON-NLS-1$ mainPane.add(LanguageBundle.getString("in_abt_license"), buildLicensePanel()); //$NON-NLS-1$ mainPane.add(LanguageBundle.getString("in_abt_awards"), buildAwardsPanel()); //$NON-NLS-1$ setLayout(new BorderLayout()); add(mainPane, BorderLayout.CENTER); mainPane.setPreferredSize(new Dimension(640, 480)); }
From source file:pcgen.gui2.dialog.AboutDialog.java
/** * Construct the credits panel. This panel shows basic details * about PCGen and lists all involved in it's creation. * * @return The credits panel.//from w w w. ja va 2 s . c o m */ private JPanel buildCreditsPanel() { JLabel versionLabel = new JLabel(); JLabel dateLabel = new JLabel(); JLabel javaVersionLabel = new JLabel(); JLabel leaderLabel = new JLabel(); JLabel helperLabel = new JLabel(); JLabel wwwLink = new JLabel(); JLabel emailLabel = new JLabel(); JTextField version = new JTextField(); JTextField releaseDate = new JTextField(); JTextField javaVersion = new JTextField(); JTextField projectLead = new JTextField(); wwwSite = new JButton(); mailingList = new JButton(); JTabbedPane monkeyTabPane = new JTabbedPane(); JPanel aCreditsPanel = new JPanel(); aCreditsPanel.setLayout(new GridBagLayout()); // Labels versionLabel.setText(LanguageBundle.getString("in_abt_version")); //$NON-NLS-1$ GridBagConstraints gridBagConstraints1 = buildConstraints(0, 0, GridBagConstraints.WEST); gridBagConstraints1.weightx = 0.2; aCreditsPanel.add(versionLabel, gridBagConstraints1); dateLabel.setText(LanguageBundle.getString("in_abt_release_date")); //$NON-NLS-1$ gridBagConstraints1 = buildConstraints(0, 1, GridBagConstraints.WEST); aCreditsPanel.add(dateLabel, gridBagConstraints1); javaVersionLabel.setText(LanguageBundle.getString("in_abt_java_version")); //$NON-NLS-1$ gridBagConstraints1 = buildConstraints(0, 2, GridBagConstraints.WEST); aCreditsPanel.add(javaVersionLabel, gridBagConstraints1); leaderLabel.setText(LanguageBundle.getString("in_abt_BD")); //$NON-NLS-1$ gridBagConstraints1 = buildConstraints(0, 3, GridBagConstraints.WEST); aCreditsPanel.add(leaderLabel, gridBagConstraints1); wwwLink.setText(LanguageBundle.getString("in_abt_web")); //$NON-NLS-1$ gridBagConstraints1 = buildConstraints(0, 4, GridBagConstraints.WEST); aCreditsPanel.add(wwwLink, gridBagConstraints1); emailLabel.setText(LanguageBundle.getString("in_abt_email")); //$NON-NLS-1$ gridBagConstraints1 = buildConstraints(0, 5, GridBagConstraints.WEST); aCreditsPanel.add(emailLabel, gridBagConstraints1); helperLabel.setText(LanguageBundle.getString("in_abt_monkeys")); //$NON-NLS-1$ gridBagConstraints1 = buildConstraints(0, 6, GridBagConstraints.NORTHWEST); aCreditsPanel.add(helperLabel, gridBagConstraints1); // Info version.setEditable(false); String versionNum = PCGenPropBundle.getVersionNumber(); if (StringUtils.isNotBlank(PCGenPropBundle.getAutobuildNumber())) { versionNum += " autobuild #" + PCGenPropBundle.getAutobuildNumber(); } version.setText(versionNum); version.setBorder(null); version.setOpaque(false); gridBagConstraints1 = buildConstraints(1, 0, GridBagConstraints.WEST); gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints1.weightx = 1.0; aCreditsPanel.add(version, gridBagConstraints1); releaseDate.setEditable(false); String releaseDateStr = PCGenPropBundle.getReleaseDate(); if (StringUtils.isNotBlank(PCGenPropBundle.getAutobuildDate())) { releaseDateStr = PCGenPropBundle.getAutobuildDate(); } releaseDate.setText(releaseDateStr); releaseDate.setBorder(new EmptyBorder(new Insets(1, 1, 1, 1))); releaseDate.setOpaque(false); gridBagConstraints1 = buildConstraints(1, 1, GridBagConstraints.WEST); gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL; aCreditsPanel.add(releaseDate, gridBagConstraints1); javaVersion.setEditable(false); javaVersion.setText( System.getProperty("java.runtime.version") + " (" + System.getProperty("java.vm.vendor") + ")"); javaVersion.setBorder(new EmptyBorder(new Insets(1, 1, 1, 1))); javaVersion.setOpaque(false); gridBagConstraints1 = buildConstraints(1, 2, GridBagConstraints.WEST); gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL; aCreditsPanel.add(javaVersion, gridBagConstraints1); projectLead.setEditable(false); projectLead.setText(PCGenPropBundle.getHeadCodeMonkey()); projectLead.setBorder(new EmptyBorder(new Insets(1, 1, 1, 1))); projectLead.setOpaque(false); gridBagConstraints1 = buildConstraints(1, 3, GridBagConstraints.WEST); gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL; aCreditsPanel.add(projectLead, gridBagConstraints1); // Web site button wwwSite.setText(PCGenPropBundle.getWWWHome()); wwwSite.addActionListener(event -> { try { DesktopBrowserLauncher.viewInBrowser(new URL(wwwSite.getText())); } catch (IOException ioe) { Logging.errorPrint(LanguageBundle.getString("in_abt_browser_err"), ioe); //$NON-NLS-1$ } }); gridBagConstraints1 = buildConstraints(1, 4, GridBagConstraints.WEST); aCreditsPanel.add(wwwSite, gridBagConstraints1); // Mailing list button mailingList.setText(PCGenPropBundle.getMailingList()); mailingList.addActionListener(event -> { try { DesktopBrowserLauncher.viewInBrowser(new URL(mailingList.getText())); } catch (IOException ioe) { Logging.errorPrint(LanguageBundle.getString("in_err_browser_err"), ioe); //$NON-NLS-1$ } }); gridBagConstraints1 = buildConstraints(1, 5, GridBagConstraints.WEST); aCreditsPanel.add(mailingList, gridBagConstraints1); // Monkey tabbed pane gridBagConstraints1 = buildConstraints(1, 6, GridBagConstraints.WEST); gridBagConstraints1.gridwidth = 2; gridBagConstraints1.weighty = 1.0; gridBagConstraints1.fill = GridBagConstraints.BOTH; aCreditsPanel.add(monkeyTabPane, gridBagConstraints1); monkeyTabPane.add(LanguageBundle.getString("in_abt_code_mky"), //$NON-NLS-1$ buildMonkeyList(PCGenPropBundle.getCodeMonkeys())); monkeyTabPane.add(LanguageBundle.getString("in_abt_list_mky"), //$NON-NLS-1$ buildMonkeyList(PCGenPropBundle.getListMonkeys())); monkeyTabPane.add(LanguageBundle.getString("in_abt_test_mky"), //$NON-NLS-1$ buildMonkeyList(PCGenPropBundle.getTestMonkeys())); monkeyTabPane.add(LanguageBundle.getString("in_abt_eng_mky"), //$NON-NLS-1$ buildMonkeyList(PCGenPropBundle.getEngineeringMonkeys())); // because there isn't one monkeyTabPane.setToolTipTextAt(2, LanguageBundle.getString("in_abt_easter_egg")); //$NON-NLS-1$ return aCreditsPanel; }
From source file:phex.gui.dialogs.AboutDialog.java
/** * //from w w w. ja v a 2 s. c o m */ private void prepareComponent() { CloseEventHandler closeEventHandler = new CloseEventHandler(); addWindowListener(closeEventHandler); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); JPanel contentPanel = new JPanel(); //JPanel contentPanel = new FormDebugPanel(); contentPane.add(contentPanel, BorderLayout.CENTER); CellConstraints cc = new CellConstraints(); FormLayout layout = new FormLayout("4dlu, fill:d:grow, 4dlu", // columns "p, p, 2dlu, p, 4dlu, p, 4dlu"); //row PanelBuilder contentPB = new PanelBuilder(layout, contentPanel); Object[] objArr = { PrivateNetworkConstants.PRIVATE_BUILD_ID + VersionUtils.getProgramVersion(), VersionUtils.getBuild() }; DialogBanner banner = new DialogBanner("Phex", Localizer.getFormatedString("AboutPhex_VersionInfo", objArr)); contentPB.add(banner, cc.xywh(1, 1, 3, 1)); contentPB.add(new JSeparator(), cc.xywh(1, 2, 3, 1)); JTabbedPane tabbedPane = new JTabbedPane(); contentPB.add(tabbedPane, cc.xy(2, 4)); JButton closeBtn = new JButton(Localizer.getString("Close")); closeBtn.addActionListener(closeEventHandler); contentPB.add(ButtonBarFactory.buildCloseBar(closeBtn), cc.xy(2, 6)); JPanel aboutPanel = new JPanel(); layout = new FormLayout("4dlu, fill:d:grow, 4dlu", // columns "4dlu, p, 4dlu"); //row PanelBuilder aboutPB = new PanelBuilder(layout, aboutPanel); tabbedPane.addTab(Localizer.getString("AboutPhex_About"), aboutPanel); Object[] objArr2 = { Res.getStr("Program.Url") }; HTMLMultiLinePanel aboutHtml = new HTMLMultiLinePanel( Localizer.getFormatedString("AboutPhex_AboutText", objArr2)); aboutPB.add(aboutHtml, cc.xy(2, 2)); JPanel envPanel = new JPanel(); layout = new FormLayout("2dlu, fill:d:grow, 2dlu", // columns "2dlu, p, 2dlu, p, 2dlu"); //row PanelBuilder envPB = new PanelBuilder(layout, envPanel); tabbedPane.addTab(Localizer.getString("AboutPhex_Environment"), envPanel); environmentInfo = new JTextArea(12, 55); environmentInfo.setEditable(false); envPB.add(new JScrollPane(environmentInfo), cc.xy(2, 2)); StringBuffer envTextBuffer = new StringBuffer(); Properties pros = System.getProperties(); ArrayList<String> list = new ArrayList(pros.keySet()); Collections.sort(list); Iterator<String> iterator = list.iterator(); while (iterator.hasNext()) { String key = iterator.next(); String value = (String) pros.get(key); envTextBuffer.append(key).append(" = ").append(value).append(SystemUtils.LINE_SEPARATOR); } environmentInfo.setText(envTextBuffer.toString()); environmentInfo.setCaretPosition(0); JButton copyBtn = new JButton(Localizer.getString("Copy")); copyBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Toolkit.getDefaultToolkit().getSystemClipboard() .setContents(new StringSelection(environmentInfo.getText()), null); } }); envPB.add(ButtonBarFactory.buildLeftAlignedBar(copyBtn), cc.xy(2, 4)); pack(); setLocationRelativeTo(getParent()); }
From source file:phex.gui.dialogs.NewDownloadDialog.java
/** * //from www. j a va 2 s . com */ private void prepareComponent() { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { closeDialog(); } }); CellConstraints cc = new CellConstraints(); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); JPanel contentPanel = new JPanel(); //JPanel contentPanel = new FormDebugPanel(); contentPane.add(contentPanel, BorderLayout.CENTER); FormLayout layout = new FormLayout("2dlu, fill:d:grow, 2dlu", // columns "p, p, 2dlu, p, 6dlu, p, 3dlu, p 6dlu"); //row PanelBuilder builder = new PanelBuilder(layout, contentPanel); DialogBanner banner = new DialogBanner(Localizer.getString("NewDownload_BannerHeader"), Localizer.getString("NewDownload_BannerSubHeader")); builder.add(banner, cc.xywh(1, 1, 3, 1)); builder.add(new JSeparator(), cc.xywh(1, 2, 3, 1)); downloadTabPane = new JTabbedPane(); JPanel urlPanel = createByUrlPanel(); downloadTabPane.addTab(Localizer.getString("NewDownload_ByUrl"), urlPanel); JPanel magmaPanel = createByMagmaPanel(); downloadTabPane.addTab(Localizer.getString("NewDownload_ByMagmaFile"), magmaPanel); JPanel rssPanel = createByRSSPanel(); downloadTabPane.addTab(Localizer.getString("NewDownload_ByRSSFile"), rssPanel); builder.add(downloadTabPane, cc.xy(2, 4)); builder.add(new JSeparator(), cc.xywh(1, 6, 3, 1)); JButton cancelBtn = new JButton(Localizer.getString("Cancel")); cancelBtn.addActionListener(new CancelBtnListener()); JButton okBtn = new JButton(Localizer.getString("OK")); okBtn.addActionListener(new OkBtnListener()); JPanel btnPanel = ButtonBarFactory.buildOKCancelBar(okBtn, cancelBtn); builder.add(btnPanel, cc.xy(2, 8)); pack(); setLocationRelativeTo(getParent()); }
From source file:pl.otros.logview.gui.LogViewMainFrame.java
public LogViewMainFrame(DataConfiguration c) throws InitializationException { super();// w w w .ja v a 2 s .c o m this.configuration = c; this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); String title = "OtrosLogViewer"; try { title += ' ' + VersionUtil.getRunningVersion(); } catch (Exception e) { LOGGER.warning("Can't load version of running OLV"); } this.setTitle(title); try { String iconPath = "img/otros/logo16.png"; if (System.getProperty("os.name").contains("Linux")) { iconPath = "img/otros/logo64.png"; } BufferedImage icon = ImageIO.read(this.getClass().getClassLoader().getResourceAsStream(iconPath)); this.setIconImage(icon); } catch (Exception e1) { LOGGER.warning("Can't load icon: " + e1.getMessage()); } Exception modalDisplayException = null; // If non-terminal load problem occurs, queue to display for user on // top of the app UI. try { OtrosSplash.setMessage("Loading plugins"); LvDynamicLoader.getInstance().setStatusObserver(OtrosSplash.getSplashStatusObserver()); LvDynamicLoader.getInstance().loadAll(); OtrosSplash.setMessage("Loading plugins loaded"); } catch (IOException e) { LOGGER.severe("Problem with loading automatic markers, filter or log importers: " + e.getMessage()); modalDisplayException = e; } catch (InitializationException ie) { // Details should have been logged at lower level modalDisplayException = ie; } OtrosSplash.setMessage("Initializing GUI"); allPluginables = AllPluginables.getInstance(); logImportersContainer = allPluginables.getLogImportersContainer(); messageColorizercontainer = allPluginables.getMessageColorizers(); searchResultColorizer = (SearchResultColorizer) messageColorizercontainer .getElement(SearchResultColorizer.class.getName()); cardLayout = new CardLayout(); cardLayoutPanel = new JPanel(cardLayout); JLabel statusLabel = new JLabel(" "); observer = new JLabelStatusObserver(statusLabel); logsTabbedPane = new JTabbedPane(); enableDisableComponetsForTabs = new EnableDisableComponetsForTabs(logsTabbedPane); logsTabbedPane.addChangeListener(enableDisableComponetsForTabs); otrosApplication = new OtrosApplication(); otrosApplication.setAllPluginables(AllPluginables.getInstance()); otrosApplication.setApplicationJFrame(this); otrosApplication.setConfiguration(configuration); otrosApplication.setjTabbedPane(logsTabbedPane); otrosApplication.setStatusObserver(observer); otrosApplication.setOtrosVfsBrowserDialog(new JOtrosVfsBrowserDialog(getVfsFavoritesConfiguration())); otrosApplication.setServices(new ServicesImpl(otrosApplication)); SingleInstanceRequestResponseDelegate.getInstance().setOtrosApplication(otrosApplication); ToolTipManager.sharedInstance().setDismissDelay(5000); JProgressBar heapBar = new JProgressBar(); heapBar.setPreferredSize(new Dimension(190, 15)); new Thread(new MemoryUsedStatsUpdater(heapBar, 1500), "MemoryUsedUpdater").start(); JPanel statusPanel = new JPanel(new MigLayout("fill", "[fill, push, grow][right][right]", "[]")); statusPanel.add(statusLabel); final JButton ideConnectedLabel = new JButton(Ide.IDEA.getIconDiscounted()); statusPanel.add(ideConnectedLabel); statusPanel.add(new JButton(new SwitchAutoJump(otrosApplication))); statusPanel.add(heapBar); initMenu(); initToolbar(); addEmptyViewListener(); addMenuBarReloadListener(); otrosApplication.setSearchField(searchField); cardLayoutPanel.add(logsTabbedPane, CARD_LAYOUT_LOGS_TABLE); EmptyViewPanel emptyViewPanel = new EmptyViewPanel(otrosApplication); final JScrollPane jScrollPane = new JScrollPane(emptyViewPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { jScrollPane.getVerticalScrollBar().setValue(0); } }); cardLayoutPanel.add(jScrollPane, CARD_LAYOUT_EMPTY); cardLayout.show(cardLayoutPanel, CARD_LAYOUT_EMPTY); enableDisableComponetsForTabs.stateChanged(null); Container cp = getContentPane(); cp.setLayout(new BorderLayout()); cp.add(toolBar, BorderLayout.NORTH); cp.add(cardLayoutPanel, BorderLayout.CENTER); cp.add(statusPanel, BorderLayout.SOUTH); initGlobalHotKeys(); initPosition(); if (configuration.getBoolean(ConfKeys.LOAD_EXPERIMENTAL_FEATURES, false)) { initExperimental(); } setTransferHandler(new DragAndDropFilesHandler(otrosApplication)); initPlugins(); OtrosSplash.hide(); setVisible(true); if (modalDisplayException != null) JOptionPane.showMessageDialog(this, "Problem with loading automatic markers," + "filter or log importers:\n" + modalDisplayException.getMessage(), "Initialization Error", JOptionPane.ERROR_MESSAGE); // Check new version on start if (c.getBoolean(ConfKeys.VERSION_CHECK_ON_STARTUP, true)) { new ChekForNewVersionOnStartupAction(otrosApplication).actionPerformed(null); } new TipOfTheDay(c).showTipOfTheDayIfNotDisabled(this); Toolkit.getDefaultToolkit().getSystemEventQueue().push(new EventQueueProxy()); ListUncaughtExceptionHandlers listUncaughtExceptionHandlers = new ListUncaughtExceptionHandlers(// new LoggingExceptionHandler(), // new ShowErrorDialogExceptionHandler(otrosApplication), // new StatusObserverExceptionHandler(observer)); Thread.setDefaultUncaughtExceptionHandler(listUncaughtExceptionHandlers); ListeningScheduledExecutorService listeningScheduledExecutorService = otrosApplication.getServices() .getTaskSchedulerService().getListeningScheduledExecutorService(); listeningScheduledExecutorService.scheduleAtFixedRate( new IdeAvailabilityCheck(ideConnectedLabel, otrosApplication.getServices().getJumpToCodeService()), 5, 5, TimeUnit.SECONDS); ideConnectedLabel.addActionListener(new IdeIntegrationConfigAction(otrosApplication)); }
From source file:pl.otros.logview.gui.LogViewPanel.java
public LogViewPanel(final LogDataTableModel dataTableModel, TableColumns[] visibleColumns, final OtrosApplication otrosApplication) { super();/*from ww w. j ava2s. c o m*/ this.dataTableModel = dataTableModel; this.otrosApplication = otrosApplication; this.statusObserver = otrosApplication.getStatusObserver(); configuration = otrosApplication.getConfiguration(); AllPluginables allPluginable = AllPluginables.getInstance(); markersContainer = allPluginable.getMarkersContainser(); markersContainer.addListener(new MarkersMenuReloader()); logFiltersContainer = allPluginable.getLogFiltersContainer(); messageColorizersContainer = allPluginable.getMessageColorizers(); messageFormattersContainer = allPluginable.getMessageFormatters(); selectedMessageColorizersContainer = new PluginableElementsContainer<MessageColorizer>(); selectedMessageFormattersContainer = new PluginableElementsContainer<MessageFormatter>(); for (MessageColorizer messageColorizer : messageColorizersContainer.getElements()) { selectedMessageColorizersContainer.addElement(messageColorizer); } for (MessageFormatter messageFormatter : messageFormattersContainer.getElements()) { selectedMessageFormattersContainer.addElement(messageFormatter); } messageColorizersContainer.addListener( new SynchronizePluginableContainerListener<MessageColorizer>(selectedMessageColorizersContainer)); messageFormattersContainer.addListener( new SynchronizePluginableContainerListener<MessageFormatter>(selectedMessageFormattersContainer)); menuLabelFont = new JLabel().getFont().deriveFont(Font.BOLD); filtersPanel = new JPanel(); logsTablePanel = new JPanel(); logsMarkersPanel = new JPanel(); leftPanel = new JPanel(new MigLayout()); logDetailTextArea = new JTextPane(); logDetailTextArea.setEditable(false); MouseAdapter locationInfo = new LocationClickMouseAdapter(otrosApplication, logDetailTextArea); logDetailTextArea.addMouseMotionListener(locationInfo); logDetailTextArea.addMouseListener(locationInfo); logDetailTextArea.setBorder(BorderFactory.createTitledBorder("Details")); logDetailWithRulerScrollPane = RulerBarHelper.wrapTextComponent(logDetailTextArea); table = new JTableWith2RowHighliting(dataTableModel); // Initialize default column visible before creating context menu table.setColumnControlVisible(true); final ColumnControlButton columnControlButton = new ColumnControlButton(table) { @Override public void togglePopup() { populatePopup(); super.togglePopup(); } @Override protected List<Action> getAdditionalActions() { final List<Action> additionalActions = super.getAdditionalActions(); final AbstractAction saveLayout = new AbstractAction("Save current to new column layout", Icons.DISK) { @Override public void actionPerformed(ActionEvent actionEvent) { String newLayoutName = JOptionPane.showInputDialog(table, "New Layout name"); if (newLayoutName == null) { return; } newLayoutName = newLayoutName.trim(); LOGGER.info(String.format("Saving New column layout '%s'", newLayoutName)); ArrayList<String> visibleColNames = new ArrayList<String>(); for (TableColumn tc : table.getColumns()) { Object o = tc.getIdentifier(); if (!(o instanceof TableColumns)) { LOGGER.severe("TableColumn identifier of unexpected type: " + tc.getIdentifier().getClass().getName()); LOGGER.warning("Throw up a pop-up"); return; } TableColumns tcs = (TableColumns) o; visibleColNames.add(tcs.getName()); } ColumnLayout columnLayout = new ColumnLayout(newLayoutName, visibleColNames); final List<ColumnLayout> columnLayouts = LogTableFormatConfigView .loadColumnLayouts(configuration); columnLayouts.add(columnLayout); LogTableFormatConfigView.saveColumnLayouts(columnLayouts, configuration); populatePopup(); } }; additionalActions.add(saveLayout); final List<ColumnLayout> columnLayoutNames = LogTableFormatConfigView .loadColumnLayouts(configuration); for (final ColumnLayout columnLayout : columnLayoutNames) { final String name = columnLayout.getName(); final AbstractAction applyColumnLayout = new ApplyColumnLayoutAction(name, Icons.EDIT_COLUMNS, columnLayout, table); additionalActions.add(applyColumnLayout); } return additionalActions; } }; table.setColumnControl(columnControlButton); List<TableColumn> columns = table.getColumns(true); for (int i = 0; i < columns.size(); i++) { columns.get(i).setIdentifier(TableColumns.getColumnById(i)); } for (TableColumn tableColumn : columns) { table.getColumnExt(tableColumn.getIdentifier()).setVisible(false); } for (TableColumns tableColumns : visibleColumns) { table.getColumnExt(tableColumns).setVisible(true); } table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); updateColumnsSize(); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); final Renderers renderers = Renderers.getInstance(otrosApplication); table.setDefaultRenderer(String.class, new TableMarkDecoratorRenderer(renderers.getStringRenderer())); table.setDefaultRenderer(Object.class, new TableMarkDecoratorRenderer(table.getDefaultRenderer(Object.class))); table.setDefaultRenderer(Integer.class, new TableMarkDecoratorRenderer(table.getDefaultRenderer(Object.class))); table.setDefaultRenderer(Level.class, new TableMarkDecoratorRenderer(renderers.getLevelRenderer())); table.setDefaultRenderer(Date.class, new TableMarkDecoratorRenderer(renderers.getDateRenderer())); final TimeDeltaRenderer timeDeltaRenderer = new TimeDeltaRenderer(); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent listSelectionEvent) { final int[] selectedRows = table.getSelectedRows(); if (selectedRows.length > 0) { final int selectedRow = selectedRows[selectedRows.length - 1]; final Date selectedDate = dataTableModel.getLogData(table.convertRowIndexToModel(selectedRow)) .getDate(); timeDeltaRenderer.setSelectedTimestamp(selectedDate); table.repaint(); } } }); table.setDefaultRenderer(TimeDelta.class, new TableMarkDecoratorRenderer(timeDeltaRenderer)); ((EventSource) configuration.getConfiguration()).addConfigurationListener(new ConfigurationListener() { @Override public void configurationChanged(ConfigurationEvent ce) { if (ce.getType() == AbstractConfiguration.EVENT_SET_PROPERTY && !ce.isBeforeUpdate()) { if (ce.getPropertyName().equals(ConfKeys.LOG_TABLE_FORMAT_DATE_FORMAT)) { table.setDefaultRenderer(Date.class, new TableMarkDecoratorRenderer(new DateRenderer( configuration.getString(ConfKeys.LOG_TABLE_FORMAT_DATE_FORMAT, "HH:mm:ss.SSS")))); updateTimeColumnSize(); } else if (ce.getPropertyName().equals(ConfKeys.LOG_TABLE_FORMAT_LEVEL_RENDERER)) { table.setDefaultRenderer(Level.class, new TableMarkDecoratorRenderer(new LevelRenderer(configuration.get( LevelRenderer.Mode.class, ConfKeys.LOG_TABLE_FORMAT_LEVEL_RENDERER, LevelRenderer.Mode.IconsOnly)))); updateLevelColumnSize(); } } } }); table.setDefaultRenderer(Boolean.class, new TableMarkDecoratorRenderer(table.getDefaultRenderer(Boolean.class))); table.setDefaultRenderer(Note.class, new TableMarkDecoratorRenderer(new NoteRenderer())); table.setDefaultRenderer(MarkerColors.class, new TableMarkDecoratorRenderer(new MarkTableRenderer())); table.setDefaultEditor(Note.class, new NoteTableEditor()); table.setDefaultEditor(MarkerColors.class, new MarkTableEditor(otrosApplication)); table.setDefaultRenderer(ClassWrapper.class, new TableMarkDecoratorRenderer(renderers.getClassWrapperRenderer())); sorter = new TableRowSorter<LogDataTableModel>(dataTableModel); for (int i = 0; i < dataTableModel.getColumnCount(); i++) { sorter.setSortable(i, false); } sorter.setSortable(TableColumns.ID.getColumn(), true); sorter.setSortable(TableColumns.TIME.getColumn(), true); table.setRowSorter(sorter); messageDetailListener = new MessageDetailListener(this, dateFormat, selectedMessageFormattersContainer, selectedMessageColorizersContainer); table.getSelectionModel().addListSelectionListener(messageDetailListener); dataTableModel.addNoteObserver(messageDetailListener); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { boolean hasFocus = otrosApplication.getApplicationJFrame().isFocused(); final boolean enabled = otrosApplication.getConfiguration() .getBoolean(ConfKeys.JUMP_TO_CODE_AUTO_JUMP_ENABLED, false); if (hasFocus && enabled && !e.getValueIsAdjusting()) { try { final LogData logData = dataTableModel .getLogData(table.convertRowIndexToModel(e.getFirstIndex())); LocationInfo li = new LocationInfo(logData.getClazz(), logData.getMethod(), logData.getFile(), Integer.valueOf(logData.getLine())); final JumpToCodeService jumpToCodeService = otrosApplication.getServices() .getJumpToCodeService(); final boolean ideAvailable = jumpToCodeService.isIdeAvailable(); if (ideAvailable) { LOGGER.fine("Jumping to " + li); jumpToCodeService.jump(li); } } catch (Exception e1) { LOGGER.warning("Can't perform jump to code " + e1.getMessage()); } } } }); notes = new JTextArea(); notes.setEditable(false); NoteObserver allNotesObserver = new AllNotesTextAreaObserver(notes); dataTableModel.addNoteObserver(allNotesObserver); addFiltersGUIsToPanel(filtersPanel); logsTablePanel.setLayout(new BorderLayout()); logsTablePanel.add(new JScrollPane(table)); JPanel messageDetailsPanel = new JPanel(new BorderLayout()); messageDetailToolbar = new JToolBar("MessageDetail"); messageDetailsPanel.add(messageDetailToolbar, BorderLayout.NORTH); messageDetailsPanel.add(logDetailWithRulerScrollPane); initMessageDetailsToolbar(); jTabbedPane = new JTabbedPane(); jTabbedPane.add("Message detail", messageDetailsPanel); jTabbedPane.add("All notes", new JScrollPane(notes)); leftPanel.add(filtersPanel, "wrap, growx"); leftPanel.add(new JSeparator(SwingConstants.HORIZONTAL), "wrap,growx"); leftPanel.add(logsMarkersPanel, "wrap,growx"); JSplitPane splitPaneLogsTableAndDetails = new JSplitPane(JSplitPane.VERTICAL_SPLIT, logsTablePanel, jTabbedPane); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(leftPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), splitPaneLogsTableAndDetails); splitPane.setOneTouchExpandable(true); this.setLayout(new BorderLayout()); this.add(splitPane); splitPaneLogsTableAndDetails.setDividerLocation(0.5d); splitPaneLogsTableAndDetails.setOneTouchExpandable(true); splitPane.setDividerLocation(leftPanel.getPreferredSize().width + 10); PopupListener popupListener = new PopupListener(new Callable<JPopupMenu>() { @Override public JPopupMenu call() throws Exception { return initTableContextMenu(); } }); table.addMouseListener(popupListener); table.addKeyListener(popupListener); PopupListener popupListenerMessageDetailMenu = new PopupListener(new Callable<JPopupMenu>() { @Override public JPopupMenu call() throws Exception { return initMessageDetailPopupMenu(); } }); logDetailTextArea.addMouseListener(popupListenerMessageDetailMenu); logDetailTextArea.addKeyListener(popupListenerMessageDetailMenu); dataTableModel.notifyAllNoteObservers(new NoteEvent(EventType.CLEAR, dataTableModel, null, 0)); table.addKeyListener(new MarkRowBySpaceKeyListener(otrosApplication)); initAcceptConditions(); }
From source file:plugins.tprovoost.Microscopy.MicroManagerForIcy.MMMainFrame.java
/** * Initialize all the GUI.//from www .j a va 2 s . c o m */ @Override public void initializeGUI() { ThreadUtil.invokeNow(new Runnable() { @Override public void run() { _camera_label = mCore.getCameraDevice(); if (_camera_label.length() > 0) { if (_combo_binning.getItemCount() > 0) { _combo_binning.removeAllItems(); } StrVector binSizes; try { binSizes = mCore.getAllowedPropertyValues(_camera_label, MMCoreJ.getG_Keyword_Binning()); } catch (Exception e1) { binSizes = new StrVector(); } ActionListener[] listeners = _combo_binning.getActionListeners(); for (int i = 0; i < listeners.length; i++) { _combo_binning.removeActionListener(listeners[i]); } for (int i = 0; i < binSizes.size(); i++) { _combo_binning.addItem(binSizes.get(i)); } _combo_binning.setMaximumRowCount((int) binSizes.size()); if (binSizes.size() == 0L) _combo_binning.setEditable(true); else { _combo_binning.setEditable(false); } for (int i = 0; i < listeners.length; i++) { _combo_binning.addActionListener(listeners[i]); } _combo_binning.setSelectedIndex(0); } try { _shutters = mCore.getLoadedDevicesOfType(DeviceType.ShutterDevice); } catch (Exception e) { e.printStackTrace(); } if (_shutters != null) { String[] items = new String[(int) _shutters.size()]; for (int i = 0; i < _shutters.size(); i++) { items[i] = _shutters.get(i); } ActionListener[] listeners = _combo_shutters.getActionListeners(); for (int i = 0; i < listeners.length; i++) { _combo_shutters.removeActionListener(listeners[i]); } if (_combo_shutters.getItemCount() > 0) { _combo_shutters.removeAllItems(); } for (int i = 0; i < items.length; i++) { _combo_shutters.addItem(items[i]); } for (int i = 0; i < listeners.length; i++) _combo_shutters.addActionListener(listeners[i]); String activeShutter = mCore.getShutterDevice(); if (activeShutter != null) _combo_shutters.setSelectedItem(activeShutter); else { _combo_shutters.setSelectedItem(""); } } // ------------ // GUI DRAW // ----------- _mainPanel.removeAll(); _panelConfig = new JPanel(); _panelConfig.setLayout(new BoxLayout(_panelConfig, BoxLayout.Y_AXIS)); _panelConfig.add(_groupPad, BorderLayout.CENTER); _panelConfig.add(_groupButtonsPanel, BorderLayout.SOUTH); _panelConfig.setPreferredSize(new Dimension(300, 300)); _panelCameraSettingsContainer = new JPanel(); _panelCameraSettingsContainer .setLayout(new BoxLayout(_panelCameraSettingsContainer, BoxLayout.Y_AXIS)); _panelCameraSettingsContainer.add(_panel_cameraSettings); _panelCameraSettingsContainer.add(Box.createVerticalGlue()); _panelAcquisitions = new JPanel(); _panelAcquisitions.setLayout(new BoxLayout(_panelAcquisitions, BoxLayout.Y_AXIS)); _panelAcquisitions.add(new JLabel("No acquisition running.")); JPanel panelPainterSettingsContainer = new JPanel(); panelPainterSettingsContainer.setLayout(new GridLayout()); panelPainterSettingsContainer.add(_panelColorChooser); _tabbedPanel = new JTabbedPane(); _tabbedPanel.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); _tabbedPanel.add("Configuration", _panelConfig); _tabbedPanel.add("Camera Settings", _panelCameraSettingsContainer); _tabbedPanel.add("Running Acquisitions", _panelAcquisitions); _tabbedPanel.add("Painter Settings", panelPainterSettingsContainer); final IcyLogo logo_title = new IcyLogo("Micro-Manager for Icy"); logo_title.setPreferredSize(new Dimension(200, 80)); _mainPanel.add(_tabbedPanel, BorderLayout.CENTER); _mainPanel.add(logo_title, BorderLayout.NORTH); _mainPanel.validate(); } }); }
From source file:qic.ui.QicFrame.java
public QicFrame(Main main, String query) { super("QIC Search - Simple GUI"); setLayout(new BorderLayout(5, 5)); RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60); textArea.setText("Enter a command in the textfield then press Enter.."); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSON); textArea.setCodeFoldingEnabled(true); RTextScrollPane sp = new RTextScrollPane(textArea); JTextField searchTf = new JTextField(100); JButton runBtn = new JButton("Run"); JPanel northPanel = new JPanel(); northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.X_AXIS)); northPanel.add(searchTf);//from w ww. j a v a 2 s .co m northPanel.add(runBtn); getContentPane().add(northPanel, BorderLayout.NORTH); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setSize(screenSize.width - 50, screenSize.height - 50); setLocationRelativeTo(null); searchTf.setText("search bo tmpsc "); if (query != null) { searchTf.setText(query); } JTable table = new JTable(); table.setDefaultRenderer(List.class, new MultiLineTableCellRenderer()); JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab("Table", new JScrollPane(table)); tabbedPane.addTab("JSON", new JScrollPane(sp)); BeanPropertyTableModel<SearchResultItem> model = new BeanPropertyTableModel<>(SearchResultItem.class); model.setOrderedProperties(asList("id", "buyout", "item", "seller", "reqs", "mods", "q", "APS", "PDPS", "EDPS", "DPS", "ele", "phys", "ar", "ev", "ES", "blk", "crit", "lvl")); table.setModel(model); setColumnWidths(table.getColumnModel(), asList(1, 15, 280, 230, 50, 420)); getContentPane().add(tabbedPane, BorderLayout.CENTER); ActionListener runCommand = e -> { String tfText = searchTf.getText(); Worker<Command> pathNotesWorker = new Worker<Command>(() -> runQuery(main, tfText), command -> { String json = command.toJson(); textArea.setText(json); model.setData(command.itemResults); }, ex -> { String stackTrace = ExceptionUtils.getStackTrace(ex); textArea.setText(stackTrace); showError(ex); }); pathNotesWorker.execute(); }; searchTf.addActionListener(runCommand); runBtn.addActionListener(runCommand); table.getSelectionModel().addListSelectionListener(e -> { if (e.getValueIsAdjusting()) { int selectedRow = table.getSelectedRow(); if (selectedRow > -1) { SearchResultItem searchResultItem = model.getData().get(selectedRow); SwingUtil.copyToClipboard(searchResultItem.wtb()); } } }); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); }
From source file:ru.goodfil.catalog.ui.forms.MainWindow.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - ???????? ???? applicationMenuBar = new JMenuBar(); applicationMenu = new JMenu(); openMenuItem = new JMenuItem(); saveAsMenuItem = new JMenuItem(); QuitMenuItem = new JMenuItem(); menu2 = new JMenu(); menuItem2 = new JMenuItem(); miImportOe = new JMenuItem(); miDeployDatabase = new JMenuItem(); miFilterFormsAndTypes = new JMenuItem(); menu1 = new JMenu(); miExportOeToExcel = new JMenuItem(); menuItem1 = new JMenuItem(); helpMenu = new JMenu(); aboutMenuItem = new JMenuItem(); tabsPanel = new JTabbedPane(); carsTab = new JPanel(); filtersTab = new JPanel(); oeTab = new JPanel(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("Goodwill - \u043a\u0430\u0442\u0430\u043b\u043e\u0433"); setIconImage(new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/car_compact_orange.png")) .getImage());/*from w w w. jav a 2 s.c om*/ Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("default:grow", "fill:default:grow")); //======== applicationMenuBar ======== { //======== applicationMenu ======== { applicationMenu.setText("\u0424\u0430\u0439\u043b"); //---- openMenuItem ---- openMenuItem.setText("\u041e\u0442\u043a\u0440\u044b\u0442\u044c..."); openMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_ap\\16x16\\plain\\folder_blue.png")); openMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openMenuItemActionPerformed(e); } }); applicationMenu.add(openMenuItem); applicationMenu.addSeparator(); //---- saveAsMenuItem ---- saveAsMenuItem .setText("\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a..."); saveAsMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_ap\\16x16\\plain\\disk_blue.png")); saveAsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveAsMenuItemActionPerformed(e); } }); applicationMenu.add(saveAsMenuItem); applicationMenu.addSeparator(); //---- QuitMenuItem ---- QuitMenuItem.setText("\u0412\u044b\u0445\u043e\u0434"); QuitMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_ap\\16x16\\plain\\exit.png")); QuitMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { QuitMenuItemActionPerformed(e); } }); applicationMenu.add(QuitMenuItem); } applicationMenuBar.add(applicationMenu); //======== menu2 ======== { menu2.setText("\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b"); //---- menuItem2 ---- menuItem2.setText("\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438..."); menu2.add(menuItem2); //---- miImportOe ---- miImportOe.setText("\u0418\u043c\u043f\u043e\u0440\u0442 \u041e\u0415..."); miImportOe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miImportOeActionPerformed(); } }); menu2.add(miImportOe); //---- miDeployDatabase ---- miDeployDatabase.setText( "\u0412\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0411\u0414 \u043d\u0430 \u0441\u0430\u0439\u0442..."); miDeployDatabase.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miDeployDatabaseActionPerformed(); } }); menu2.add(miDeployDatabase); //---- miFilterFormsAndTypes ---- miFilterFormsAndTypes.setText( "\u0422\u0438\u043f\u044b \u0438 \u0444\u043e\u0440\u043c\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432..."); miFilterFormsAndTypes.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miFilterFormsAndTypesActionPerformed(e); } }); menu2.add(miFilterFormsAndTypes); //======== menu1 ======== { menu1.setText("\u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 OE \u0432 Exel"); //---- miExportOeToExcel ---- miExportOeToExcel .setText("\u041a\u0430\u0442\u0430\u043b\u043e\u0433 (\u041a\u043d\u0438\u0433\u0430)"); miExportOeToExcel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miExportOeToExcelActionPerformed(e); } }); menu1.add(miExportOeToExcel); //---- menuItem1 ---- menuItem1.setText( "\u041a\u0440\u043e\u0441\u0441\u044b (\u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d)"); menuItem1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem1ExportOeCross(e); } }); menu1.add(menuItem1); } menu2.add(menu1); } applicationMenuBar.add(menu2); //======== helpMenu ======== { helpMenu.setText("\u0421\u043f\u0440\u0430\u0432\u043a\u0430"); //---- aboutMenuItem ---- aboutMenuItem.setText("\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435..."); aboutMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_op\\16x16\\plain\\banana.png")); aboutMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { aboutMenuItemActionPerformed(e); } }); helpMenu.add(aboutMenuItem); } applicationMenuBar.add(helpMenu); } setJMenuBar(applicationMenuBar); //======== tabsPanel ======== { //======== carsTab ======== { // JFormDesigner evaluation mark carsTab.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), carsTab.getBorder())); carsTab.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); carsTab.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < carsTab.getComponentCount(); i++) { Rectangle bounds = carsTab.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = carsTab.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; carsTab.setMinimumSize(preferredSize); carsTab.setPreferredSize(preferredSize); } } tabsPanel.addTab("\u041c\u0430\u0448\u0438\u043d\u044b", carsTab); //======== filtersTab ======== { filtersTab.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < filtersTab.getComponentCount(); i++) { Rectangle bounds = filtersTab.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = filtersTab.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; filtersTab.setMinimumSize(preferredSize); filtersTab.setPreferredSize(preferredSize); } } tabsPanel.addTab("\u0418\u0437\u0434\u0435\u043b\u0438\u044f", filtersTab); //======== oeTab ======== { oeTab.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < oeTab.getComponentCount(); i++) { Rectangle bounds = oeTab.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = oeTab.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; oeTab.setMinimumSize(preferredSize); oeTab.setPreferredSize(preferredSize); } } tabsPanel.addTab("\u041e\u0415", oeTab); } contentPane.add(tabsPanel, cc.xy(1, 1)); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents carsTab.setLayout(new BorderLayout()); carsPanel = new CarsPanel(); carsTab.add(carsPanel, BorderLayout.CENTER); filtersTab.setLayout(new BorderLayout()); filtersPanel = new FiltersPanel(); filtersTab.add(filtersPanel, BorderLayout.CENTER); oeTab.setLayout(new BorderLayout()); oePanel = new OePanel(); oeTab.add(oePanel, BorderLayout.CENTER); }