javax.swing.JTextPane.setVisible()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中javax.swing.JTextPane.setVisible()方法的一些代码示例,展示了JTextPane.setVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.setVisible()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:setVisible

JTextPane.setVisible介绍

暂无

代码示例

代码示例来源:origin: vsch/flexmark-java

public static void setRegExError(String error, JTextPane jTextPane, final Font textFont, final BackgroundColor validTextFieldBackground, final BackgroundColor warningTextFieldBackground) {
  HtmlBuilder html = new HtmlBuilder();
  html.tag("html").style("margin:2px;vertical-align:middle;").attr(validTextFieldBackground, textFont).tag("body");
  html.attr(warningTextFieldBackground).tag("div");
  html.append(toHtmlError(error, true));
  html.closeTag("div");
  html.closeTag("body");
  html.closeTag("html");
  jTextPane.setVisible(true);
  jTextPane.setText(html.toFinalizedString());
  jTextPane.revalidate();
  jTextPane.getParent().revalidate();
  jTextPane.getParent().getParent().revalidate();
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

private void setStatusMessage(String message, boolean isError) {
 statusPane.setText(message);
 statusPane.setVisible(true);
 statusPanel.setVisible(true);
 errorIcon.setVisible(isError);
}

代码示例来源:origin: tflobbe/solrmeter

public void beginExtraction() {
 progressBar.setVisible(true);
 progressBar.setIndeterminate(true);
 buttonExtract.setEnabled(false);
 textPaneExtractionDetails.setVisible(false);
}

代码示例来源:origin: tflobbe/solrmeter

private void endExtraction(String message) {
  progressBar.setIndeterminate(false);
  progressBar.setValue(100);
  progressBar.setString(I18n.get(message));
  textPaneExtractionDetails.setVisible(true);
  buttonExtract.setEnabled(true);
  
 }
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

@Override
 public void run() {
  warningMessage.setText(message);
  warningMessage.setVisible(true);
  warningIcon.setVisible(true);
  cloudSdkDirectoryField.getTextField().setForeground(JBColor.red);
 }
});

代码示例来源:origin: tinyMediaManager/tinyMediaManager

public void setDetails(String details) {
 textPane.setText(details);
 textPane.setVisible(true);
 textPane.setCaretPosition(0);
 scrollPane.setVisible(true);
}

代码示例来源:origin: hneemann/Digital

@Override
  public void close() {
    html.append("</table></html>");
    switch (count) {
      case 0:
        statusBar.setVisible(false);
        allSolutionsDialog.setVisible(false);
        break;
      case 1:
        statusBar.setVisible(true);
        statusBar.setText(firstExp);
        allSolutionsDialog.setVisible(false);
        break;
      default:
        statusBar.setVisible(false);
        allSolutionsDialog.setText(html.toString());
        if (!allSolutionsDialog.isVisible())
          SwingUtilities.invokeLater(() -> allSolutionsDialog.setVisible(true));
    }
  }
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

@VisibleForTesting
protected void hideWarning() {
 invokePanelValidationUpdate(
   () -> {
    cloudSdkDirectoryField.getTextField().setForeground(JBColor.black);
    warningIcon.setVisible(false);
    warningMessage.setVisible(false);
   });
}

代码示例来源:origin: stackoverflow.com

protected JPanel createPanel(String input) {
  JPanel inst = new JPanel();
  inst.setVisible(true);
  final JTextField textField = new JTextField();
  textField.setVisible(true);
  textField.setBounds(12, 12, 80, 30);
  JButton button = new JButton();        
  button.setVisible(true);
  button.setBounds(100, 12, 80, 30);
  final JTextPane textPane = new JTextPane();
  textPane.setBounds(12, 54, 168, 40);
  inst.add(textPane);
  textPane.setVisible(true);

  button.addActionListener(new ActionListener(){

    @Override
    public void actionPerformed(ActionEvent arg0) {
      textPane.setText(textPane.getText() + textField.getText());
    }});

  inst.setLayout(null);
  inst.add(button);
  inst.add(textField);
  ary.add(inst);
  tabIndex = index;
  index++;
  return inst;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mylyn-util

private void setEditing(boolean editing) {
  if (editing) {
    btnEditPreview.setEnabled(textCode.getDocument().getLength() != 0);
    btnEditPreview.setIcon(ICON_PREVIEW);
    btnEditPreview.setToolTipText(NbBundle.getMessage(WikiEditPanel.class, "TOOL_Preview"));
    textCode.setVisible(true);
    scrollCode.setVisible(true);
    textPreview.setVisible(false);
    scrollPreview.setVisible(false);
    textCode.requestFocus();
  } else {
    btnEditPreview.setEnabled(true);
    btnEditPreview.setIcon(ICON_EDIT);
    btnEditPreview.setToolTipText(NbBundle.getMessage(WikiEditPanel.class, "TOOL_Edit"));
    textPreview.setVisible(true);
    scrollPreview.setVisible(true);
    textCode.setVisible(false);
    scrollCode.setVisible(false);
    if (this.editing != editing) {
      setWikiFormatText(textCode.getText());
    }
  }
  this.editing = editing;
  this.revalidate();
  this.repaint();
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

protected HashPanel(final String header) {

  super(new BorderLayout());
  
  setBorder(BorderFactory.createCompoundBorder(BorderFactory
      .createTitledBorder(header), BorderFactory.createEmptyBorder(
          5, 5, 5, 5)));
  
  // Text panes -> Comments
  hashTextPane = new JTextPane();
  
  hashTextPane.putClientProperty("charset", "UTF-8");
  hashTextPane.setEditable(false);
  hashTextPane.setVisible(true);
  hashTextPane.setFont(new Font("Verdana", Font.BOLD, 10));
  hashTextPane.setMargin(new Insets(1, 1, 1, 1));
  hashTextPane.setBackground(Color.LIGHT_GRAY);
  hashTextPane.setForeground(new Color(51, 51, 102));
  final JScrollPane hashScrollPane = new JScrollPane(hashTextPane,
      JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
      JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  this.add(hashScrollPane, BorderLayout.CENTER);
  
  hashTextPane.setText("Select Alt + Enter to Encode / Alt + Backspace to decode");
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

public CloudSdkPanel() {
 warningMessage.setVisible(false);
 warningMessage.setBackground(cloudSdkPanel.getBackground());
 warningMessage.addHyperlinkListener(new BrowserOpeningHyperLinkListener());
 warningIcon.setVisible(false);
 warningIcon.setIcon(RunConfigurations.ConfigurationWarning);
 checkManagedSdkFeatureStatus();
 initEvents();
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

textPane.setVisible(false);
textPane.setEditable(false);
scrollPane.setViewportView(textPane);

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

private JTextPane createEditablePane() {
  JTextPane textPane = new JTextPane();
  // Get the preferences for wrapping lines of text
  final boolean wrapText = JBroFuzz.PREFS.getBoolean(
      JBroFuzzPrefs.FUZZING[2].getId(), false);
  if (wrapText) {
    textPane = new JTextPane();
  } else {
    textPane = new NonWrappingTextPane();
  }
  textPane.putClientProperty("charset", "UTF-8");
  textPane.setEditable(true);
  textPane.setVisible(true);
  textPane.setFont(new Font("Verdana", Font.PLAIN, 12));
  textPane.setMargin(new Insets(1, 1, 1, 1));
  textPane.setBackground(Color.WHITE);
  textPane.setForeground(Color.BLACK);
  // Set the editor kit responsible for highlighting
  textPane.setEditorKit(new StyledEditorKit() {
    private static final long serialVersionUID = -6085642347022880064L;
    public Document createDefaultDocument() {
      return new TextHighlighter();
    }
  });
  // Right click: Cut, Copy, Paste, Select All
  RightClickPopups.rightClickRequestTextComponent(this, textPane);
  return textPane;
}

代码示例来源:origin: tflobbe/solrmeter

this.textPaneExtractionDetails.setVisible(false);
this.textPaneExtractionDetails.setEditable(false);
this.textPaneExtractionDetails.setEnabled(true);

代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

this.circularDependencyIsNeededTextPane.setVisible(false);
this.circularDependencyIsNeededTextPane.setDisabledTextColor(JBColor.RED);
this.circularDependencyCheckBox.addActionListener(e -> circularDependencyIsNeededTextPane.setVisible(((JCheckBox) e
  .getSource()).isVisible()));
this.circularDependencyIsNeededLabel.addMouseListener(new MouseAdapter() {

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

enTextPane.setVisible(true);
enTextPane.setFont(new Font("Verdana", Font.PLAIN, 12));
deTextPane.setVisible(true);
deTextPane.setFont(new Font("Verdana", Font.PLAIN, 12));

代码示例来源:origin: com.vladsch.flexmark/flexmark-util

public static void setRegExError(String error, JTextPane jTextPane, final Font textFont, final BackgroundColor validTextFieldBackground, final BackgroundColor warningTextFieldBackground) {
  HtmlBuilder html = new HtmlBuilder();
  html.tag("html").style("margin:2px;vertical-align:middle;").attr(validTextFieldBackground, textFont).tag("body");
  html.attr(warningTextFieldBackground).tag("div");
  html.append(toHtmlError(error, true));
  html.closeTag("div");
  html.closeTag("body");
  html.closeTag("html");
  jTextPane.setVisible(true);
  jTextPane.setText(html.toFinalizedString());
  jTextPane.revalidate();
  jTextPane.getParent().revalidate();
  jTextPane.getParent().getParent().revalidate();
}

相关文章

JTextPane类方法