これは実行時にJTextPane
テキストが入力されています。複数行のテキストを取得したときに、 を保持している の高さが動的に変化するようにします。JPanel
JTextPane
JPanel
JTextPane
JTextPane
これは、これまでに得たものです。
pnlChatMsgs = new JPanel(new BorderLayout());
pnlChatMsgs.setBackground(new java.awt.Color(244, 244, 244));
pnlMainTable.add(pnlChatMsgs, c);
pnlMidLiveType = new JPanel(new BorderLayout());
pnlMidLiveType.setPreferredSize(new Dimension(100, 30));
JTextPane.setFont(new java.awt.Font("Lucida Grande", 0, 13));
JTextPane.setText("<html></html>");
JTextPane.setContentType("text/html");
JTextPane.setForeground(new java.awt.Color(153, 153, 153));
JTextPane.setBackground(new java.awt.Color(250, 250, 250));
pnlMidLiveType.add(JTextPane, BorderLayout.NORTH);
pnlChatMsgs.add(pnlMidLiveType, BorderLayout.SOUTH);
pnlMidLiveType.setVisible(false);
サイズが大きくなったら、 JPanelJTextPane
の高さを変更したいと思います。pnlMidLiveType
どうすればこれを達成できますか?