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

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

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

JTextArea.setAutoscrolls介绍

暂无

代码示例

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

@Override
public JPanel createControlPanel() {
  textArea.setEditable(false);
  textArea.setLineWrap(true);
  textArea.setAutoscrolls(true);
  JScrollPane scrollPane = new JScrollPane(textArea);
  JPanel panel = new JPanel(new MigLayout("wrap 1", "[grow]", "[grow][]"));
  panel.add(scrollPane, "grow");
  return panel;
}

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

JTextArea txtArea = new JTextArea(40,100);
       txtArea.setAutoscrolls(true);
       txtArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
       txtArea.setFont(new Font("courier new", Font.PLAIN, 12));
       txtArea.setLineWrap(true);
       txtArea.setText(j);
       JScrollPane txtAreaScroll = new JScrollPane (txtArea, 
       JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
       txtAreaScroll.setViewportView(txtArea);
       txtAreaScroll.setAutoscrolls(true);
       // now add scroll pane in frame

代码示例来源:origin: LibraryOfCongress/bagger

private JScrollPane createConsoleArea() {
 serializedArea = new JTextArea();
 serializedArea.setToolTipText(ApplicationContextUtil.getMessage("consolepane.msg.help"));
 serializedArea.setEditable(false);
 serializedArea.setLineWrap(true);
 serializedArea.setBackground(textBackground);
 serializedArea.setWrapStyleWord(true);
 serializedArea.setAutoscrolls(true);
 serializedArea.setBorder(BorderFactory.createLineBorder(Color.black));
 return new JScrollPane(serializedArea);
}

代码示例来源:origin: org.geotools/gt-swing

@Override
public JPanel createControlPanel() {
  textArea.setEditable(false);
  textArea.setLineWrap(true);
  textArea.setAutoscrolls(true);
  JScrollPane scrollPane = new JScrollPane(textArea);
  JPanel panel = new JPanel(new MigLayout("wrap 1", "[grow]", "[grow][]"));
  panel.add(scrollPane, "grow");
  
  return panel;
}

代码示例来源:origin: fr.ifremer/isis-fish

/**
 * Display a JOptionPane with a JTextArea as main component.
 * 
 * @param parent parent
 * @param labelMessage label message
 * @param textMessage text message into area
 * @param title
 * @param option
 * @return user response
 */
protected int showTextAreaConfirmationMessage(Component parent,
    String labelMessage, String textMessage, String title, int option) {
  JLabel labelForMessage = new JLabel(labelMessage);
  JTextArea areaForMessage = new JTextArea(textMessage);
  areaForMessage.setEditable(false);
  areaForMessage.setAutoscrolls(true);
  JScrollPane spMessage = new JScrollPane(areaForMessage);
  spMessage.setPreferredSize(new Dimension(500, 100)); // don't remove popup is huge
  int response = JOptionPane.showConfirmDialog(parent, new Object[] {
      labelForMessage, spMessage }, title, option);
  return response;
}

代码示例来源:origin: org.biomoby/taverna-biomoby

/**
 * This method initializes jTextArea    
 *     
 * @return javax.swing.JTextArea    
 */    
private JTextArea getTextArea() {
  if (textArea == null) {
    textArea = new JTextArea();
  }
  textArea.setLineWrap(true);
  textArea.setWrapStyleWord(true);
  textArea.setText(this.text);
  textArea.setEditable(false);
  textArea.setEnabled(true);
  textArea.setAutoscrolls(true);
  textArea.setCaretPosition(0);
  return textArea;
}

代码示例来源:origin: fr.ifremer/isis-fish

/**
 * Display dialog with files list, and specifique label.
 * 
 * @param dialogTitle dialog title
 * @param labelTitle labelTitle
 * @param conflictFiles conflict files
 */
protected static void warnFileListDialog(String dialogTitle, String labelTitle, List<File> conflictFiles) {
  // construit une chaine plutot qu'un Arrays.toString() qui
  // est illisible
  String conflictFilesString = "";
  String separator = "";
  for (File file : conflictFiles) {
    conflictFilesString += separator + file.toString();
    separator = "\n";
  }
  
  JLabel labelModifiedFiles = new JLabel(labelTitle);
  JTextArea areaModifiedFiles = new JTextArea(conflictFilesString);
  areaModifiedFiles.setEditable(false);
  areaModifiedFiles.setAutoscrolls(true);
  JScrollPane sp = new JScrollPane(areaModifiedFiles);
  sp.setPreferredSize(new Dimension(500, 100)); // don't remove popup is huge
  
  JOptionPane.showMessageDialog(null, new Component[] { labelModifiedFiles, sp},
      dialogTitle,
      JOptionPane.WARNING_MESSAGE);
}

代码示例来源:origin: LibraryOfCongress/bagger

public void addConsoleMessages(String message) {
 if (message != null && message.trim().length() != 0) {
  Document consoleMessageDoc = serializedArea.getDocument();
  String date = new Date().toString();
  serializedArea.append("\n[" + date + "]: " + message);
  if (consoleMessageDoc.getLength() > MAX_CONSOLE_MESSAGE_LENGTH) {
   try {
    consoleMessageDoc.remove(0, consoleMessageDoc.getLength() - MAX_CONSOLE_MESSAGE_LENGTH);
   }
   catch (BadLocationException e) {
    log.error("Could not remove message from console",e);
    throw new RuntimeException(e);
   }
  }
  serializedArea.setAutoscrolls(true);
  serializedArea.setCaretPosition(consoleMessageDoc.getLength());
 }
}

代码示例来源:origin: apache/axis2-java

protected void initDescription(String desc) {
  this.descriptionLabel = new JTextArea(desc);
  this.descriptionLabel.setOpaque(false);
  this.descriptionLabel.setEditable(false);
  this.descriptionLabel.setAutoscrolls(true);
  this.descriptionLabel.setBounds(0, 0, descWidth, descHeight);
  this.add(this.descriptionLabel);
}

代码示例来源:origin: SINTEF-9012/JArduino

public LogPanel() {
  setLayout(null);
  setBorder(BorderFactory.createTitledBorder("Log"));
  textArea = new JTextArea();
  
  textArea.setLineWrap(true);
  textArea.setWrapStyleWord(true);
  textArea.setEditable(false);
  textArea.setFocusable(false);
  textArea.setAutoscrolls(true);
  
   editorScrollPane = new JScrollPane(textArea);
  editorScrollPane.setVerticalScrollBarPolicy(
          JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  editorScrollPane.setBounds(10, 21, 739, 149);
  add(editorScrollPane);
  
  JButton btnNewButton = new JButton("Clear Log");
  btnNewButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent arg0) {
      textArea.setText("");
    }
  });
  btnNewButton.setBounds(10, 181, 739, 23);
  add(btnNewButton);
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

jTADescricao.setLineWrap(true);
jTADescricao.setWrapStyleWord(true);
jTADescricao.setAutoscrolls(false);
jTADescricao.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
jTADescricao.setFocusable(false);

代码示例来源:origin: triplea-game/triplea

label.setFont(new Font("Segoe UI", Font.PLAIN, 12));
label.setEditable(false);
label.setAutoscrolls(true);
label.setLineWrap(false);
label.setFocusable(true);

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

myText.setAutoscrolls(true);
myText.setBackground(Color.LIGHT_GRAY);

代码示例来源:origin: triplea-game/triplea

label.setFont(new Font("Segoe UI", Font.PLAIN, 12));
label.setEditable(false);
label.setAutoscrolls(true);
label.setLineWrap(false);
label.setFocusable(false);

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

jTADescricao.setLineWrap(true);
jTADescricao.setWrapStyleWord(true);
jTADescricao.setAutoscrolls(false);
jTADescricao.setBorder(null);
jTADescricao.setFocusable(false);
jTALicenca.setColumns(20);
jTALicenca.setRows(5);
jTALicenca.setAutoscrolls(false);
jTALicenca.setBorder(null);
jTALicenca.setFocusable(false);

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

textArea.setAutoscrolls(true);
this.getContentPane().add(textArea, BorderLayout.CENTER);

代码示例来源:origin: otros-systems/otroslogviewer

border = BorderFactory.createTitledBorder(Messages.getMessage("preview.fileContent"));
contentArea.setBorder(border);
contentArea.setAutoscrolls(false);
contentArea.setFont(new Font("Courier New", Font.PLAIN, contentArea.getFont().getSize()));

代码示例来源:origin: fr.ifremer/isis-fish

JTextArea areaModifiedFiles = new JTextArea(modifiedFiles);
areaModifiedFiles.setEditable(false);
areaModifiedFiles.setAutoscrolls(true);
JScrollPane sp = new JScrollPane(areaModifiedFiles);
sp.setPreferredSize(new Dimension(500, 100)); // don't remove popup is huge

代码示例来源:origin: fr.inria.wimmics/kggui

textAreaLines.setBackground(new Color(230, 230, 230));
textAreaLines.setForeground(Color.black);
textAreaLines.setAutoscrolls(true);
textAreaLines.add(textPaneQuery);
textAreaLines.setMargin(new Insets(3, 1, 1, 1));

代码示例来源:origin: Wimmics/corese

textAreaLines.setBackground(new Color(230, 230, 230));
textAreaLines.setForeground(Color.black);
textAreaLines.setAutoscrolls(true);
textAreaLines.add(textPaneQuery);
textAreaLines.setMargin(new Insets(3, 1, 1, 1));

相关文章

JTextArea类方法