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

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

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

JTextPane.setEditable介绍

暂无

代码示例

代码示例来源: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: wiztools/rest-client

JTextPane jtp = new JTextPane();
jtp.setEditable(false);
jtp.setContentType("text/html");
jtp.setText(MessageI18N.getMessage("menu.help.about"));

代码示例来源:origin: wiztools/rest-client

jp_help.setLayout(new BorderLayout());
JTextPane jtp_help_center = new JTextPane();
jtp_help_center.setEditable(false);
Dimension d = jtp_help_center.getPreferredSize();
jtp_help_center.setText(helpText);

代码示例来源:origin: chewiebug/GCViewer

private void initComponents(String fileName) {
  super.initComponents();
  
  JTextPane textPane = new JTextPane();
  textPane.setEditable(false);
  textPane.setContentType("text/html");
  textPane.addHyperlinkListener(new HyperlinkAdapter(this));
  
  try {
    textPane.setText(readFile(fileName));
    textPane.setCaretPosition(0);
  }
  catch (IOException e) {
    e.printStackTrace();
  }
  
  JScrollPane scrollPane = new JScrollPane(
      textPane,
      JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
      JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  
  getContentPane().add("Center", scrollPane);
  pack();
}

代码示例来源:origin: kiegroup/optaplanner

private JComponent createNoPlannerFoundTextField() {
  String infoMessage = "No planner benchmarks have been found in the benchmarkDirectory ("
      + benchmarkAggregator.getBenchmarkDirectory() + ").";
  JTextPane textPane = new JTextPane();
  textPane.setEditable(false);
  textPane.setText(infoMessage);
  // center info message
  StyledDocument styledDocument = textPane.getStyledDocument();
  SimpleAttributeSet center = new SimpleAttributeSet();
  StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
  StyleConstants.setBold(center, true);
  styledDocument.setParagraphAttributes(0, styledDocument.getLength(),
      center, false);
  return textPane;
}

代码示例来源:origin: RipMeApp/ripme

logText = new JTextPane();
logText.setEditable(false);
JScrollPane logTextScroll = new JScrollPane(logText);
logTextScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

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

jTextPane_PromptDisplay = new javax.swing.JTextPane();
jTextPane_nextSentence = new javax.swing.JTextPane();
jLabel_SessionStatus = new javax.swing.JLabel();
jPanel_AdminControls = new javax.swing.JPanel();
jTextPane_PromptDisplay.setEditable(false);
jTextPane_PromptDisplay.setFont(new java.awt.Font("Tahoma", 0, 30));
jTextPane_PromptDisplay
jTextPane_nextSentence.setEditable(false);
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 = new javax.swing.JTextPane();
jLabel_SessionStatus = new javax.swing.JLabel();
jProgressBar_SpeakerProgress = new javax.swing.JProgressBar();
jLabel_PromptTotal = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextPane_nextSentence = new javax.swing.JTextPane();
jTextPane_PromptDisplay.setEditable(false);
jTextPane_PromptDisplay.setFont(new java.awt.Font("Tahoma", 0, 36));
jTextPane_PromptDisplay

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

/**
 * Creates a non-editable widget to display the detailed stack trace.
 */
JScrollPane createDetailedMessage(Throwable t)
{
  stacktrace = new JTextPane();
  stacktrace.setEditable(false);
  JScrollPane pane = new JScrollPane(stacktrace,
      JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
      JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  return pane;
}

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

private JTextPane createTextView(COSString cosString)
{
  JTextPane textPane = new JTextPane();
  textPane.setText(getTextString(cosString));
  textPane.setEditable(false);
  return textPane;
}

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

lblMessage = new javax.swing.JTextPane();
spnAmount = new javax.swing.JSpinner();
panelCommands = new javax.swing.JPanel();
jScrollPane1.setFocusable(false);
lblMessage.setEditable(false);
lblMessage.setText("long text long text long text long text long text long text long text long text");
lblMessage.setCursor(null);

代码示例来源: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: 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() {
  scrollPane = new javax.swing.JScrollPane();
  text = new javax.swing.JTextPane();
  setFocusable(false);
  setMinimumSize(new Dimension(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT));
  setName("bigCardPanel"); // NOI18N
  setOpaque(false);
  setPreferredSize(getMinimumSize());
  setLayout(null);
  scrollPane.setBorder(null);
  scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  scrollPane.setOpaque(false);
  text.setEditable(false);
  text.setFocusable(false);
  text.setOpaque(false);
  scrollPane.setViewportView(text);
  add(scrollPane);
  scrollPane.setBounds(20, 230, 210, 120);
  scrollPane.setBounds(new Rectangle(CONTENT_MAX_XOFFSET, TEXT_MAX_YOFFSET, TEXT_MAX_WIDTH, TEXT_MAX_HEIGHT));
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: pentaho/mondrian

jSplitPane1 = new javax.swing.JSplitPane();
jScrollPane1 = new javax.swing.JScrollPane();
queryTextPane = new javax.swing.JTextPane();
jScrollPane2 = new javax.swing.JScrollPane();
resultTextPane = new javax.swing.JTextPane();
connectButton = new javax.swing.JButton();
jPopupMenu = new JPopupMenu();
resultTextPane.setEditable(false);
resultTextPane.setFont(new java.awt.Font("Courier New", 0, 12));
jScrollPane2.setViewportView(resultTextPane);

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

JTextPane jtp = new JTextPane();
jtp.setContentType("text/html");
jtp.setFont(new Font(Font.DIALOG, Font.PLAIN, 14));
    BorderFactory.createEmptyBorder(0, 10, 10, 10)));
jtp.setText(aText);
jtp.setEditable(false);
jtp.setCaretPosition(0);

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

public Console() {
  super("Console");
  JTextPane consoleMessages = new JTextPane();
  consoleMessages.setMargin(new Insets(2, 20, 2, 5));
  consoleMessages.setFont(Theme.EDITOR_FONT);
  consoleMessages.setEditable(false);
  consoleMessages.addMouseListener(new MouseAdapter() {
    @Override

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

final JTextPane browser = new JTextPane();
browser.setContentType("text/html");
browser.setEditable(false);

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

private JTextPane getSecondaryTextPane() {
  secondary = new JTextPane();
  secondary.setEditable(false);
  return secondary;
}

代码示例来源:origin: zgqq/mah

private void initContent() {
  this.content = new JTextPane();
  this.content.setEditable(false);
  this.middlePanel.add(this.content);
}

代码示例来源:origin: zgqq/mah

private void initDescription() {
  this.description = new JTextPane();
  this.description.setEditable(false);
  this.middlePanel.add(this.description);
}

相关文章

JTextPane类方法