JComponent () { JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 1.0, 0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, JBInsets.create(5, 0), 0, 0); JTextField text1 = new JTextField(); new ComponentValidator(getDisposable()). withHyperlinkListener(e -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { System.out.println("Text1 link clicked. Desc = " + e.getDescription()); } }).withValidator(() -> { String tt = text1.getText(); if (StringUtil.isNotEmpty(tt)) { try { Integer.parseInt(tt); return null; } catch (NumberFormatException nex) { return new ValidationInfo("Warning, expecting a number.<br/>Visit the <a href=\"#link.one\">information link</a>" + "<br/>Or <a href=\"#link.two\">another link</a>", text1).asWarning(); } } else { return null; } }).withFocusValidator(() -> { String tt = text1.getText(); if (StringUtil.isNotEmpty(tt)) { try { int i = Integer.parseInt(tt); return i == 555 ? new ValidationInfo("Wrong number", text1).asWarning() : null; } catch (NumberFormatException nex) { return new ValidationInfo("Warning, expecting a number.", text1).asWarning(); } } else { return null; } }).andRegisterOnDocumentListener(text1).installOn(text1); Dimension d = text1.getPreferredSize(); text1.setPreferredSize(new Dimension(JBUIScale.scale(100), d.height)); JTextField text2 = new JTextField(); new ComponentValidator(getDisposable()). withHyperlinkListener(e -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { System.out.println("Text2 link clicked. Desc = " + e.getDescription()); } }).withValidator(() -> { String tt = text2.getText(); return StringUtil.isEmpty(tt) || tt.length() < 5 ? new ValidationInfo("'" + tt + "': message is too short.<br/>Should contain at least 5 symbols. 8 is preferred <a href=\"#check.rules\">check rules.</a>", text2) : tt.length() < 8 ? new ValidationInfo("'" + tt + "': message of 8 symbols is preferred", text2).asWarning() : null; }).andStartOnFocusLost().andRegisterOnDocumentListener(text2).installOn(text2); JCheckBox cb1 = new JCheckBox("Scroll tab layout"); cb1.addActionListener(e -> pane.setTabLayoutPolicy(cb1.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT : JTabbedPane.WRAP_TAB_LAYOUT)); gc.gridy++; topPanel.add(UI.PanelFactory.panel(cb1). withComment("Set tabbed pane tabs layout property to SCROLL_TAB_LAYOUT"). createPanel(), gc); JCheckBox cb2 = new JCheckBox("Full border"); cb2.addActionListener(e -> pane.putClientProperty("JTabbedPane.hasFullBorder", Boolean.valueOf(cb2.isSelected()))); gc.gridy++; topPanel.add(UI.PanelFactory.panel(cb2). withTooltip("Enable full border around the tabbed pane").createPanel(), gc); // Abracadabra button gc.gridy++; JButton abracadabraButton = new JButton("Abracadabra"); new HelpTooltip().setDescription(LONG_TEXT2).installOn(abracadabraButton); topPanel.add(UI.PanelFactory.panel(abracadabraButton).resizeX(false).createPanel(), gc); try { new GotItTooltip("Abracadabda.button", GOT_IT_TEXT, project). withShowCount(3). withHeader(GOT_IT_HEADER). withIcon(AllIcons.General.BalloonInformation). withBrowserLink("Learn more", new URL("https://www.jetbrains.com/")). show(abracadabraButton, GotItTooltip.BOTTOM_MIDDLE); new GotItTooltip("textfield", GOT_IT_TEXT2, project).withShowCount(5).show(text1, GotItTooltip.BOTTOM_MIDDLE); } catch (MalformedURLException ex) {} JBScrollPane pane = new JBScrollPane(createTable()); pane.setPreferredSize(JBUI.size(400, 300)); pane.putClientProperty(UIUtil.KEEP_BORDER_SIDES, SideBorder.ALL); BorderLayoutPanel mainPanel = JBUI.Panels.simplePanel(UI.PanelFactory.panel(pane). withLabel("Table label:").moveLabelOnTop(). withComment("&lt;Project&gt; is content roots of all modules, all immediate descendants<br/>of the projects base directory, and .idea directory contents").resizeY(true).createPanel()); mainPanel.addToTop(topPanel); return mainPanel; }