简体   繁体   中英

a retractable JTextArea with scrollpane

Goodevening

how can have a JTextArea like in netbeans (see the pic)

替代文字
(source: hostingpics.net )

my code of the 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应用程序中创建了可停靠的窗口(假设这就是您所说的“可伸缩”)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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