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

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

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

JTextPane.setBorder介绍

暂无

代码示例

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

JTextPane f = new JTextPane();
f.setContentType("text/html"); // let the text pane know this is what you want
f.setText("<html>Hello World</html>"); // showing off
f.setEditable(false); // as before
f.setBackground(null); // this is the same as a JLabel
f.setBorder(null); // remove the border

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

jTextPane_PromptDisplay.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jTextPane_PromptDisplay.setEditable(false);
jTextPane_PromptDisplay.setFont(new java.awt.Font("Tahoma", 0, 36));
jTextPane_nextSentence.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jTextPane_nextSentence.setFont(new java.awt.Font("Tahoma", 0, 24));
jTextPane_nextSentence.setForeground(new java.awt.Color(50, 50, 50));

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

jTextPane_PromptDisplay.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jTextPane_PromptDisplay.setEditable(false);
jTextPane_PromptDisplay.setFont(new java.awt.Font("Tahoma", 0, 30));
jTextPane_nextSentence.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jTextPane_nextSentence.setEditable(false);
jTextPane_nextSentence.setFont(new java.awt.Font("Tahoma", 0, 24));

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

/**
 * Build new instance of JTextArea to decorate.
 */
public JPopupTextPane(JTextPane proxy) {
  super(proxy);
  this.getProxy().addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(FocusEvent arg0) {
      JPopupTextPane.this.getProxy().getCaret().setVisible(true);
      JPopupTextPane.this.getProxy().getCaret().setSelectionVisible(true);
    }
  });
  this.getProxy().setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  this.getProxy().setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
}

代码示例来源:origin: magefree/mage

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  jScrollPane1 = new javax.swing.JScrollPane();
  text = new javax.swing.JTextPane();
  setMinimumSize(getPreferredSize());
  setOpaque(false);
  setPreferredSize(new Dimension(dimension.frameWidth, dimension.frameHeight));
  setLayout(null);
  jScrollPane1.setBorder(null);
  jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  jScrollPane1.setFocusable(false);
  jScrollPane1.setOpaque(false);
  text.setBorder(null);
  text.setEditable(false);
  text.setFont(new java.awt.Font("Arial", 0, 9));
  text.setFocusable(false);
  text.setOpaque(false);
  jScrollPane1.setViewportView(text);
  add(jScrollPane1);
  jScrollPane1.setBounds(20, 110, 130, 100);
  jScrollPane1.setBounds(new Rectangle(dimension.contentXOffset, dimension.textYOffset, dimension.textWidth, dimension.textHeight));
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: RaiMan/SikuliX2

aText = String.format(header, jtp.getFont().getFamily()) + aText;
jtp.setBorder(BorderFactory.createCompoundBorder(
    BorderFactory.createLineBorder(Color.magenta, 2),
    BorderFactory.createEmptyBorder(0, 10, 10, 10)));

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

public void setBorder(Border border) {
  outerBorder = border;
  // Override to set the outer border
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public void setBorder(Border border) {
  outerBorder = border;
  // Override to set the outer border
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: org.protege/protege-editor-owl

public void setBorder(Border border) {
  outerBorder = border;
  // Override to set the outer border
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void setBorder(Border border) {
  outerBorder = border;
  // Override to set the outer border
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

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

public void setStateBorder(Border border) {
  stateBorder = border;
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public void setStateBorder(Border border) {
  stateBorder = border;
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: org.protege/protege-editor-owl

public void setStateBorder(Border border) {
  stateBorder = border;
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

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

public void setStateBorder(Border border) {
  stateBorder = border;
  this.parent.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void setStateBorder(Border border) {
  stateBorder = border;
  super.setBorder(BorderFactory.createCompoundBorder(outerBorder, stateBorder));
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void setBorder(Border _b)
{
 Border b=_b;
 if(b!=null) b=new CompoundBorder(b,new EmptyBorder(0,30,0,0));
 else        b=new EmptyBorder(0,30,0,0);
 super.setBorder(b);
}

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

JTextPane f = new JTextPane();
f.setContentType("text/html"); // let the text pane know this is what you want
f.setEditable(false); // as before
f.setBackground(null); // this is the same as a JLabel
f.setBorder(null); // remove the border

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

private void prepareTextPane() {
  parent.setBorder(null);
  doc = parent.getStyledDocument();
  resetStyles();
}

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

for (int i = 0; i < 5; i++) {
  final JTextPane b = new JTextPane();
  b.setBorder(new JTextArea().getBorder());
  b.addFocusListener(new FocusListener() {

    @Override
    public void focusGained(FocusEvent arg0) {
      b.repaint();
    }

    @Override
    public void focusLost(FocusEvent arg0) {
      b.repaint();
    }

  });
  b.setText(Integer.toString(i));
  a.getContentPane().add(b);
}

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

private void prepareTextPane() {
  resetStyles();
  parent.setBorder(null);
  parent.getStyledDocument().addDocumentListener(
    new DocumentListener() {
      @Override public void insertUpdate(DocumentEvent e) { handleDocumentUpdated(); }
      @Override public void removeUpdate(DocumentEvent e) { handleDocumentUpdated(); }
      @Override public void changedUpdate(DocumentEvent e) { /* NO-OP */ }
    }
  );
}

相关文章

JTextPane类方法