作者:ndo2205188 | 来源:互联网 | 2023-09-23 14:56
Iwanttocreatesomethinglikethis:我想创建这样的东西:Mainpanelhasitsmargins(x),andTextAreain
I want to create something like this:
我想创建这样的东西:
Main panel has its margins (x), and TextArea in the center of that panel which almost fills up the panel. At the bottom is another panel with custom size (height y), which can be toggled visible and unvisible with some shortcut. Bottom Panel has FlowLayout and few elements.
主面板的边距(x)和TextArea位于该面板的中心,几乎填满了面板。在底部是另一个具有自定义尺寸(高度y)的面板,可以通过一些快捷方式切换为可见和不可见。底部面板具有FlowLayout和少量元素。
The problem is I have no idea how to do this.
问题是我不知道该怎么做。
BoxLayout has no margins.
BoxLayout没有边距。
I tried with GridBagLayout but I doesn't work or I can't understand it enough :(
我尝试使用GridBagLayout,但我不工作或我不能理解它:(
I tried also with setting JTextArea margins
我也试过设置JTextArea边距
textMain.setMargin(new Insets(insetTop, insetLeft, insetBottom, insetRight));
but when there is a lot of text, top and bottom margin disappear. So now I'm trying with Panels.
但是当有大量文本时,顶部和底部边距消失。所以现在我正在尝试使用Panels。
Can someone help me with this please?
有人可以帮帮我吗?
1 个解决方案