javax.swing.JEditorPane.addHyperlinkListener()方法的使用及代码示例

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

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

JEditorPane.addHyperlinkListener介绍

暂无

代码示例

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

panel.add(infoLabel);
JEditorPane pane = new JEditorPane("text/html", "<a href=\"https://github.com/libgdx/libgdx/wiki/Dependency-management-with-Gradle\">Dependency Management</a>");
pane.addHyperlinkListener(new HyperlinkListener() {
  @Override
  public void hyperlinkUpdate(HyperlinkEvent e) {

代码示例来源:origin: bobbylight/RSyntaxTextArea

/**
 * Sets the listener for hyperlink events in this tip window.
 *
 * @param listener The new listener.  The old listener (if any) is
 *        removed.  A value of <code>null</code> means "no listener."
 */
public void setHyperlinkListener(HyperlinkListener listener) {
  // We've added a separate listener, so remove only the user's.
  if (userHyperlinkListener!=null) {
    textArea.removeHyperlinkListener(userHyperlinkListener);
  }
  userHyperlinkListener = listener;
  if (userHyperlinkListener!=null) {
    textArea.addHyperlinkListener(userHyperlinkListener);
  }
}

代码示例来源:origin: apache/tika

private void textDialog(String title, URL resource) {
  try {
    JDialog dialog = new JDialog(this, title);
    JEditorPane editor = new JEditorPane(resource);
    editor.setContentType("text/html");
    editor.setEditable(false);
    editor.setBackground(Color.WHITE);
    editor.setPreferredSize(new Dimension(400, 250));
    editor.addHyperlinkListener(this);
    dialog.add(editor);
    dialog.pack();
    dialog.setVisible(true);
  } catch (IOException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: Nilhcem/FakeSMTP

ep.addHyperlinkListener(new HyperlinkListener() {
  @Override
  public void hyperlinkUpdate(HyperlinkEvent e) {

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

jep.setOpaque(false);//so we dont see whit background
jep.addHyperlinkListener(new HyperlinkListener() {
  @Override
  public void hyperlinkUpdate(HyperlinkEvent hle) {

代码示例来源:origin: ron190/jsql-injection

text[0].addHyperlinkListener(linkEvent -> {
  if (HyperlinkEvent.EventType.ACTIVATED.equals(linkEvent.getEventType())) {
    try {

代码示例来源:origin: bobbylight/RSyntaxTextArea

textArea.addHyperlinkListener(new HyperlinkListener() {
  @Override
  public void hyperlinkUpdate(HyperlinkEvent e) {

代码示例来源:origin: igniterealtime/Spark

/**
   * Adds a hyperlink listener for notification of any changes, for example when a link is selected and entered.
   *
   * @param listener the listener
   */
  public void setHyperlinkListener(HyperlinkListener listener) {
    browser.addHyperlinkListener(listener);
  }
}

代码示例来源:origin: org.nuiton/nuiton-widgets

/**
 * Build about tab.
 * 
 * @return about tab component
 */
protected Component getAboutTab() {
  JEditorPane htmlAbout = new JEditorPane("text/html", aboutHtmlText);
  htmlAbout.addHyperlinkListener(this);
  htmlAbout.setEditable(false);
  return htmlAbout;
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

/**
 * Build about tab.
 *
 * @return about tab component
 */
protected Component getAboutTab() {
  JEditorPane htmlAbout = new JEditorPane("text/html", aboutHtmlText);
  htmlAbout.addHyperlinkListener(this);
  htmlAbout.setEditable(false);
  return htmlAbout;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

private void initComponents() {
  rapportPane = new JEditorPane("text/html; charset=UTF-8", ""); //$NON-NLS-1$ //$NON-NLS-2$
  rapportPane.setEditable(false);
  rapportPane.addHyperlinkListener(new MyHyperlinkListener());
}

代码示例来源:origin: com.synaptix/SynaptixSwing

private void initComponents() {
  rapportPane = new JEditorPane("text/html; charset=UTF-8", ""); //$NON-NLS-1$ //$NON-NLS-2$
  rapportPane.setEditable(false);
  rapportPane.addHyperlinkListener(new MyHyperlinkListener());
  logoLabel = new JLabel();
  logoLabel.setHorizontalAlignment(JLabel.CENTER);
}

代码示例来源:origin: de.sciss/scisslib

public void setHyperlinkListener(HyperlinkListener l) {
  if(this.hyperlinkListener != null) {
    ggCredits.removeHyperlinkListener(this.hyperlinkListener);
  }
  this.hyperlinkListener = l;
  if(l != null) {
    ggCredits.addHyperlinkListener(l);
  }
}

代码示例来源:origin: com.synaptix/SynaptixWidget

private void initComponents() {
  rapportPane = new JEditorPane("text/plain; charset=UTF-8", ""); //$NON-NLS-1$ //$NON-NLS-2$
  rapportPane.setEditable(false);
  rapportPane.addHyperlinkListener(new MyHyperlinkListener());
}

代码示例来源:origin: onyxbits/Raccoon

public static SearchView create(MainActivity mainActivity, Archive archive) {
  SearchView ret = new SearchView(mainActivity, archive);
  ret.query.addActionListener(ret);
  ret.page.addChangeListener(ret);
  ret.cancel.addActionListener(ret);
  ret.message.addHyperlinkListener(new BrowseUtil());
  ret.doMessage(""); //$NON-NLS-1$
  ret.message.addHyperlinkListener(ret);
  return ret;
}

代码示例来源:origin: protegeproject/protege

private void createTextPanel() {
  JEditorPane pane = new JEditorPane();
  pane.setBorder(new EmptyBorder(12, 12, 12, 12));
  pane.setPreferredSize(new Dimension(300, 200));
  pane.setEditable(false);
  pane.addHyperlinkListener(event -> {
    if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED &&
      event.getURL() != null) {
      NativeBrowserLauncher.openURL(event.getURL().toString());
    }
  });
}

代码示例来源:origin: org.cytoscape/swing-application-impl

/** Creates new form WSAboutDialog */
public AboutDialogImpl(Window parent, boolean modal, OpenBrowser ob) {
  // TODO: This is supported only in Java 6...
  //super(parent, modal);
  super();
  this.setModal(modal);
  this.openBrowser = ob;
  initComponents();
  mainEditorPane.setEditable(false);
  mainEditorPane.addHyperlinkListener(this);
  setLocationRelativeTo(parent);
}

代码示例来源:origin: cytoscape/application

/** Creates new form WSAboutDialog */
public AboutDialog(java.awt.Frame parent, boolean modal) {
  super(parent, modal);
  initComponents();
  mainEditorPane.setEditable(false);
  mainEditorPane.addHyperlinkListener(this);
  setLocationRelativeTo(Cytoscape.getDesktop());
  setAlwaysOnTop(true);
}

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

private void createUIComponents() {
    final Font font = UIManager.getFont("Label.font");
    final String bodyRule = "body { font-family: " + font.getFamily() + "; " + "font-size: " + font.getSize() + "pt; }";
    discountEditorPane = new JEditorPane();
    discountEditorPane.setEditorKit(new HTMLEditorKit());
    ((HTMLDocument) discountEditorPane.getDocument()).getStyleSheet().addRule(bodyRule);
    discountEditorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  }
}

代码示例来源:origin: org.cytoscape/webservice-impl

/** Creates new form WSAboutDialog */
public AboutDialog(Window parent, Dialog.ModalityType modal, final OpenBrowser openBrowser) {
  super(parent, modal);
  this.openBrowser = openBrowser;
  initComponents();
  mainEditorPane.setEditable(false);
  mainEditorPane.addHyperlinkListener(this);
  setLocationRelativeTo(parent);
  setModalityType(DEFAULT_MODALITY_TYPE);
  this.setPreferredSize(WINDOW_SIZE);
  this.setSize(WINDOW_SIZE);
}

相关文章

JEditorPane类方法