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

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

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

JTextPane.setAutoscrolls介绍

暂无

代码示例

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

  1. jTextPane_PromptDisplay
  2. .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.");
  3. jTextPane_PromptDisplay.setAutoscrolls(false);
  4. jTextPane_PromptDisplay.addComponentListener(new java.awt.event.ComponentAdapter() {
  5. public void componentResized(java.awt.event.ComponentEvent evt) {

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

  1. jTextPane_PromptDisplay
  2. .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.");
  3. jTextPane_PromptDisplay.setAutoscrolls(false);

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

  1. private static Component initConsole() {
  2. // TODO: implement possibility to configure the desired log level
  3. Logger root = Logger.getLogger("");
  4. JTextPane consoleTextArea = new JTextPane();
  5. JScrollPane consoleScrollPane = new JScrollPane();
  6. consoleScrollPane.setViewportBorder(null);
  7. consoleScrollPane.setViewportView(consoleTextArea);
  8. consoleTextArea.setEditable(false);
  9. consoleTextArea.setBackground(AssetPanel.BACKGROUND);
  10. consoleTextArea.setForeground(Color.WHITE);
  11. consoleTextArea.setAutoscrolls(true);
  12. root.addHandler(new ConsoleLogHandler(consoleTextArea));
  13. return consoleScrollPane;
  14. }

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

  1. public static JScrollPane createJTextPane(){
  2. screen = new JTextPane();
  3. screen.setFocusable(false);
  4. screen.setEditable(false);
  5. screen.setAutoscrolls(true);
  6. JScrollPane editorScrollPane = new JScrollPane(screen);
  7. editorScrollPane.setVerticalScrollBarPolicy(
  8. JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  9. editorScrollPane.setPreferredSize(new Dimension(480, 240));
  10. editorScrollPane.setMinimumSize(new Dimension(320, 160));
  11. StyledDocument doc = screen.getStyledDocument();
  12. Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
  13. Random rnd = new Random();
  14. Style receivedigitalReadResultStyle = doc.addStyle("receivedigitalReadResultStyle", def);
  15. StyleConstants.setForeground(receivedigitalReadResultStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
  16. Style receiveanalogReadResultStyle = doc.addStyle("receiveanalogReadResultStyle", def);
  17. StyleConstants.setForeground(receiveanalogReadResultStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
  18. Style receivepongStyle = doc.addStyle("receivepongStyle", def);
  19. StyleConstants.setForeground(receivepongStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
  20. Style receiveinterruptNotificationStyle = doc.addStyle("receiveinterruptNotificationStyle", def);
  21. StyleConstants.setForeground(receiveinterruptNotificationStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
  22. Style receiveeeprom_valueStyle = doc.addStyle("receiveeeprom_valueStyle", def);
  23. StyleConstants.setForeground(receiveeeprom_valueStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
  24. Style receiveeeprom_write_ackStyle = doc.addStyle("receiveeeprom_write_ackStyle", def);
  25. StyleConstants.setForeground(receiveeeprom_write_ackStyle, new Color(rnd.nextInt(176), rnd.nextInt(176), rnd.nextInt(176)));
  26. return editorScrollPane;
  27. }

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

  1. screen.setFocusable(false);
  2. screen.setEditable(false);
  3. screen.setAutoscrolls(true);

相关文章

JTextPane类方法