问题标签 [border-layout]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 布局管理器推荐
我正在为街机游戏创建 GUI。它由一个 JFrame 和一些 JPanel 和一个 JMenu 组成,如图所示:
我一直在尝试使用 BorderLayout,但它没有正确显示面板。我得到的是 JMenu 正确显示。[1] 调整其宽度以包含其中的按钮。JPanel [2] 几乎完成了屏幕的其余部分。并且 [3] 在末尾显示为一条细线。
这是我用来放置它们的代码片段:
欢迎提出任何可能引发这种行为的建议。
java - ActionListener only works for part of the method
Currently I have a JFrame 'window' with the layout set to BorderLayout. I have a panel for the west and center sections, with two alternating panels for south. In the west section I have 5 labels. In the center section I have 5 JTextField components. And in the south section i want to alternate between two panels (both FlowLayout) &(each one holds 2 separate buttons).
Right now I initialize and the south section has the correct two buttons, but when i call my event action listener only half of the method is called correctly. Behind the scenes i have the menu item connected to the listener, and it seems to work correctly. the clear text method works but changing the south panel does not
here are the panels and frame being initialized(they are initialized in the class constructor):
the clear textfields method works perfectly, it clears my JTextFields
extjs4 - Extjs 4 / Sencha Architect - 边界布局中的两个相同区域
我在 Sencha Architect 中使用 Extjs 4。我有 2 个按钮,当我按下第一个按钮时,底部会显示“Panel_1”。我使用父面板上的边框布局和子面板“Panel_1”上的南部区域来制作它。
现在我需要做同样的事情并在按下 button_2 时在同一位置显示“Panel_2”。但似乎我无法在边框布局中的同一区域(南部)设置两个面板。
关于如何做到这一点的任何其他想法?
c# - 如何在 C# Winforms 中绘制 Windows 窗体的边框?
如何将我们的 Winforms 显示为 MetroUI .. 不使用 3rd 方 dll ......我的意思是如何绘制表单的边框
我没有这个..但是它给出了静态颜色我想改变颜色...所以请给我一些想法
java - 在边框布局中组件的顶部(z 顺序)添加 JComponent
边框布局非常流行,因为它可以拉伸其内容以适应父组件。所以我有一些用 布局的 JComponent,BorderLayout.CENTER
我需要在它的顶部显示另一个 JComponent。作为某种属性窗口或其他东西。有什么常见的方法可以做到这一点,还是我应该重建整个应用程序?
java - 如何使用 BorderLayout 将两个具有首选大小的标签添加到面板?
我正在尝试将标签添加到面板的北部和南部,并将面板添加到框架的中心。如果我不自己指定标签的大小,程序是完美的,但是当我给它们特定的尺寸时:
它变得一团糟!但是面板和框架的尺寸更大,有(100,100)
什么想法吗?
java - JButton 小按钮
我正在写一个摇摆程序。但问题是我想要的 JButton 很小。它的高度和宽度应该由我来决定,但下面的代码会创建一个长的水平按钮。
请帮忙
java - 请举例说明如何使用 MigLayout 模拟 BorderLayout?
我希望布局WEST
的EAST
一部分具有恒定的宽度。如何设置这个MigLayout
?
更新
以下代码不会像边框布局那样调整大小:
窗口内部的大小保持不变:
css - 边框定位:如何?
我想定位边界,但这不起作用。这是CSS:
问题是这个容器包含菜单链接。所以如果我调整宽度和边距,边框就会随之而来。但我想单独设计它......我该怎么做?
java - JavaSwing 布局混乱/困难
我还在试图弄清楚 JavaSwing 中的 BorderLayout,这真的很令人沮丧。
我希望能够将一个窗格拆分为 3 个包含的子面板,但我不完全确定如何包含它。
这是我的游戏类,它包含面板 ControlPanel、StatePanel 和 Board(实际上只是 JPanel 的扩展)。我想将面板分成三个部分,如下所示:
到目前为止,这是我的代码:
最好,这将使用 BorderLayout,但我似乎做错了。我已经尝试阅读 Oracle 提供的材料,但它们并不是特别有用。在这一点上,我想要硬编码值,但我知道我应该能够拆分它,让每个面板尽可能多地占用更大的游戏面板。