开发者

a retractable JTextArea with scrollpane

开发者 https://www.devze.com 2022-12-28 19:45 出处:网络
Goodevening how can have a JTextArea like in netbeans (see the pic) (source: hostingpics.net) my code of the JTextArea:

Goodevening

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

a retractable JTextArea with scrollpane

(source: hostingpics.net)

my code of the JTextArea:

   JTextArea  infoArea = new JTextArea(10,10);
   infoArea.setLineWrap(true);
   infoArea.setF开发者_Python百科ont(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


I'm not sure what NetBeans uses, but we used flexdock at my last company to create dockable windows in a Java Swing application (assuming this is what you meant by "retractable").

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号