Closed wyj3531 closed 2 years ago
What you're probably looking for is aligning components by their baseline.
I recommend reading this official article on Swing's GroupLayout
-
https://docs.oracle.com/javase/tutorial/uiswing/layout/groupExample.html
Specifically "Vertical layout" section that has some examples.
I'm personally not completely sure whether JTextPane
supports baseline alignment or not, but considering that JTextArea
does - I don't see any reasons why JTextPane
wouldn't.
just like pic ,i use jTextPane add the button(data1), and input the text( testest).and how i make the both in center vertical . i custom a boxview can make the button in center vertical . but the input text how to do ?