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

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

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

JTextPane.setAutoscrolls介绍

暂无

代码示例

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

jTextPane_PromptDisplay
    .setText("This is a long and boring test sentence, the only purpose of which is to see how to break between lines without making any difference across the windows.");
jTextPane_PromptDisplay.setAutoscrolls(false);
jTextPane_PromptDisplay.addComponentListener(new java.awt.event.ComponentAdapter() {
  public void componentResized(java.awt.event.ComponentEvent evt) {

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

jTextPane_PromptDisplay
    .setText("This is a long and boring test sentence, the only purpose of which is to see how to break between lines without making any difference across the windows.");
jTextPane_PromptDisplay.setAutoscrolls(false);

代码示例来源:origin: gurkenlabs/litiengine

private static Component initConsole() {
 // TODO: implement possibility to configure the desired log level
 Logger root = Logger.getLogger("");
 JTextPane consoleTextArea = new JTextPane();
 JScrollPane consoleScrollPane = new JScrollPane();
 consoleScrollPane.setViewportBorder(null);
 consoleScrollPane.setViewportView(consoleTextArea);
 consoleTextArea.setEditable(false);
 consoleTextArea.setBackground(AssetPanel.BACKGROUND);
 consoleTextArea.setForeground(Color.WHITE);
 consoleTextArea.setAutoscrolls(true);
 root.addHandler(new ConsoleLogHandler(consoleTextArea));
 return consoleScrollPane;
}

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

public static JScrollPane createJTextPane(){
  screen = new JTextPane();
  screen.setFocusable(false);
  screen.setEditable(false);
  screen.setAutoscrolls(true);
   JScrollPane editorScrollPane = new JScrollPane(screen);
  editorScrollPane.setVerticalScrollBarPolicy(
          JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  editorScrollPane.setPreferredSize(new Dimension(480, 240));
  editorScrollPane.setMinimumSize(new Dimension(320, 160));
  
  StyledDocument doc = screen.getStyledDocument();
  Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
    
  Random rnd = new Random();
  Style receivedigitalReadResultStyle = doc.addStyle("receivedigitalReadResultStyle", def);
  StyleConstants.setForeground(receivedigitalReadResultStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));	
  Style receiveanalogReadResultStyle = doc.addStyle("receiveanalogReadResultStyle", def);
  StyleConstants.setForeground(receiveanalogReadResultStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));	
  Style receivepongStyle = doc.addStyle("receivepongStyle", def);
  StyleConstants.setForeground(receivepongStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));	
  Style receiveinterruptNotificationStyle = doc.addStyle("receiveinterruptNotificationStyle", def);
  StyleConstants.setForeground(receiveinterruptNotificationStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));	
  Style receiveeeprom_valueStyle = doc.addStyle("receiveeeprom_valueStyle", def);
  StyleConstants.setForeground(receiveeeprom_valueStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));	
  Style receiveeeprom_write_ackStyle = doc.addStyle("receiveeeprom_write_ackStyle", def);
  StyleConstants.setForeground(receiveeeprom_write_ackStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));	
  return editorScrollPane;
}

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

screen.setFocusable(false);
screen.setEditable(false);
screen.setAutoscrolls(true);

相关文章

JTextPane类方法