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

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

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

JEditorPane.validate介绍

暂无

代码示例

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

JEditorPane jp = new JEditorPane("text/html", textString);
jp.validate();
int w = jp.getWidth(), h = jp.getHeight();
BufferedImage saveimg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = saveimg.createGraphics();
jp.paint(g2);

代码示例来源:origin: org.ihtsdo/wb-api

/**
 * Add a JEditorPane to the bottom on the dialog.
 */
private void addMessagePanel() {
  htmlPanel = new JPanel();
  htmlPane = new JEditorPane("text/html", "");
  htmlPane.setEditable(false);
  htmlPane.validate();
  htmlPanel.setLayout(new GridLayout(1, 1));
  htmlPanel.setPreferredSize(new Dimension(100, 100));
  htmlPanel.add(new JScrollPane(htmlPane), BorderLayout.CENTER);
  htmlPanel.validate();
  GridBagConstraints c = new GridBagConstraints();
  c.fill = GridBagConstraints.BOTH;
  c.gridx = 0;
  c.gridy = 1;
  c.gridwidth = 3;
  c.weightx = 1.0;
  c.weighty = 1.0;
  c.anchor = GridBagConstraints.SOUTH;
  startTime = new Date().getTime();
  lastReportTime = startTime;
  timer.activity.getViewPanel(false).add(htmlPanel, c);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
  HTMLDocument doc = (HTMLDocument) issuesInfoPane.getDocument();
  issuesInfoPane.setText(_appStr);
  issuesInfoPane.validate();
  issuesInfoPane.setCaretPosition(0);
  registerHTMLButton(doc, "enter", new ActionListener() { //NOI18N

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

public void run() {
    commChannelsDisplayer.setText(_istr);
    commChannelsDisplayer.validate();
    commChannelsDisplayer.setCaretPosition(0);
    HTMLDocument htm = (HTMLDocument) commChannelsDisplayer.getDocument();
    Element e = htm.getElement(CHAT_BUTTON);
    if (e != null) {
      AttributeSet attr = e.getAttributes();
      Enumeration enu = attr.getAttributeNames();
      while (enu.hasMoreElements()) {
        Object name = enu.nextElement();
        Object value = attr.getAttribute(name);
        if ("model".equals(name.toString())) { //NOI18N
          final DefaultButtonModel model = (DefaultButtonModel) value;
          model.setActionCommand(CHAT_BUTTON);
          model.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              ChatTopComponent ct = ChatTopComponent.findInstance();
              ct.open();
              ct.requestActive();
              ct.setActiveGroup(instProj.getName() + "@muc." + instProj.getKenai().getUrl().getHost()); // NOI18N
            }
          });
        }
      }
    }
  }
});

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

JEditorPane.validate();

相关文章

JEditorPane类方法