简体   繁体   English

带滚动窗格的可伸缩JTextArea

[英]a retractable JTextArea with scrollpane

Goodevening 晚上好

how can have a JTextArea like in netbeans (see the pic) 如何在Netbeans中拥有一个JTextArea(参见图片)

替代文字
(source: hostingpics.net ) (来源: hostingpics.net

my code of the JTextArea: 我的JTextArea代码:

   JTextArea  infoArea = new JTextArea(10,10);
   infoArea.setLineWrap(true);
   infoArea.setFont(police);
   infoArea.setForeground(Color.YELLOW);
   infoArea.setBackground(Color.BLACK);
   infoArea.setEditable(false);

   JScrollPane scroll = new JScrollPane(infoArea);
   scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
   scroll.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
   scroll.setPreferredSize(new Dimension(sousFrame.getWidth(),90));
   scroll.setFont( new Font("Arial", Font.BOLD, 13));
   scroll.setBorder(BorderFactory.createTitledBorder("Output"));

thank you 谢谢

我不确定NetBeans会使用什么,但是我们在上一家公司使用flexdock在Java Swing应用程序中创建了可停靠的窗口(假设这就是您所说的“可伸缩”)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM