javax.swing.JTextArea.setTabSize()方法的使用及代码示例

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

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

JTextArea.setTabSize介绍

暂无

代码示例

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

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

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

JTextArea stackTraceTextArea = new JTextArea(30, 80);
stackTraceTextArea.setEditable(false);
stackTraceTextArea.setTabSize(4);
stackTraceTextArea.append(trace);
JScrollPane stackTraceScrollPane = new JScrollPane(stackTraceTextArea,

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

setBackground(ColorScheme.DARK_GRAY_COLOR);
notesEditor.setTabSize(2);
notesEditor.setLineWrap(true);
notesEditor.setWrapStyleWord(true);

代码示例来源:origin: camunda/camunda-bpm-platform

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

area.setWrapStyleWord(true);
area.setEditable(false);
area.setTabSize(4); // looks better for module sys messages than 8

代码示例来源:origin: jshiell/checkstyle-idea

private void initialise() {
  setBorder(new EmptyBorder(8, 8, 8, 8));
  final JLabel infoLabel = new JLabel(CheckStyleBundle.message("config.file.error.caption"));
  infoLabel.setBorder(new EmptyBorder(0, 0, 8, 0));
  add(infoLabel, BorderLayout.NORTH);
  errorField.setEditable(false);
  errorField.setTabSize(2);
  final JScrollPane errorScrollPane = new JBScrollPane(errorField, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_ALWAYS);
  add(errorScrollPane, BorderLayout.CENTER);
}

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

/**
 * Workaround, since in JDK1.4 it appears that <code>setTabSize()</code>
 * doesn't work for a <code>JTextArea</code> unless you use the constructor
 * specifying the number of rows and columns...<p>
 * Sets the number of characters to expand tabs to. This will be multiplied
 * by the maximum advance for variable width fonts. A PropertyChange event
 * ("tabSize") is fired when the tab size changes.
 *
 * @param size Number of characters to expand to.
 */
@Override
public void setTabSize(int size) {
  super.setTabSize(size);
  boolean b = getLineWrap();
  setLineWrap(!b);
  setLineWrap(b);
}

代码示例来源:origin: org.wso2.dss/dataservice-client-samples

private void setInfoText(String name, String type, String size) {
  this.infoTextArea.setTabSize(4);
  if (name == null) {
    this.infoTextArea.setText("Name:\t----\nType:\t----\nSize:\t----\n");
    return;
  }
  if (size == null || size.trim().length() == 0) {
    size = "0";
  }
  this.infoTextArea.setText("Name:\t" + name + "\nType:\t" + type + "\nSize:\t" + size + " bytes\n");
}

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

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: org.apache.activemq/activemq-all

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: apache-log4j/log4j

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: org.apache.log4j/com.springsource.org.apache.log4j

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: org.jboss.logmanager/log4j-jboss-logmanager

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.log4j

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

protected JTextArea createDetailTextArea() {
 JTextArea detailTA = new JTextArea();
 detailTA.setFont(new Font("Monospaced", Font.PLAIN, 14));
 detailTA.setTabSize(3);
 detailTA.setLineWrap(true);
 detailTA.setWrapStyleWord(false);
 return (detailTA);
}

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

public static void main(String[] args) {
   String Boundary1 = JOptionPane.showInputDialog(null, "Please enter the first boundary of the multiplication table.");
   String Boundary2 = JOptionPane.showInputDialog(null, "Please enter the second boundary of the multiplication table.");
   int X = Integer.parseInt(Boundary1);
   int Y = Integer.parseInt(Boundary2);
   int j = 1;
   String Result = "";
   int x = 1;
   while (x <= X) {
     for (int i = 1; i <= Y; i++) {
       j = i * x;
       Result = Result + j + "\t";
     }
     x++;
     Result = Result + "\n";
   }
   JTextArea jt=new JTextArea(Result);
   jt.setEditable(false);
   jt.setOpaque(false);
   jt.setTabSize(3);
   JOptionPane.showMessageDialog(null, jt);
 }

代码示例来源:origin: robo-code/robocode

public JTextArea getTextPane() {
  if (textArea == null) {
    textArea = new JTextArea();
    textArea.setEditable(false);
    textArea.setTabSize(4);
    textArea.setBackground(Color.DARK_GRAY);
    textArea.setForeground(Color.WHITE);
    textArea.setBounds(0, 0, 1000, 1000);
    textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    // Make sure the caret is not reset every time text is updated, meaning that
    // the view will not reset it's position until we want it to.
    ((DefaultCaret) textArea.getCaret()).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
  }
  return textArea;
}

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

/**
 * Workaround, since in JDK1.4 it appears that <code>setTabSize()</code>
 * doesn't work for a <code>JTextArea</code> unless you use the constructor
 * specifying the number of rows and columns...<p>
 * Sets the number of characters to expand tabs to. This will be multiplied
 * by the maximum advance for variable width fonts. A PropertyChange event
 * ("tabSize") is fired when the tab size changes.
 *
 * @param size Number of characters to expand to.
 */
public void setTabSize(int size) {
  super.setTabSize(size);
  boolean b = getLineWrap();
  setLineWrap(!b);
  setLineWrap(b);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-editor

/**
 * Workaround, since in JDK1.4 it appears that <code>setTabSize()</code>
 * doesn't work for a <code>JTextArea</code> unless you use the constructor
 * specifying the number of rows and columns...<p>
 * Sets the number of characters to expand tabs to. This will be multiplied
 * by the maximum advance for variable width fonts. A PropertyChange event
 * ("tabSize") is fired when the tab size changes.
 *
 * @param size Number of characters to expand to.
 */
public void setTabSize(int size) {
  super.setTabSize(size);
  boolean b = getLineWrap();
  setLineWrap(!b);
  setLineWrap(b);
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

/**
 * Workaround, since in JDK1.4 it appears that <code>setTabSize()</code>
 * doesn't work for a <code>JTextArea</code> unless you use the constructor
 * specifying the number of rows and columns...<p>
 * Sets the number of characters to expand tabs to. This will be multiplied
 * by the maximum advance for variable width fonts. A PropertyChange event
 * ("tabSize") is fired when the tab size changes.
 *
 * @param size Number of characters to expand to.
 */
@Override
public void setTabSize(int size) {
  super.setTabSize(size);
  boolean b = getLineWrap();
  setLineWrap(!b);
  setLineWrap(b);
}

相关文章

JTextArea类方法