English 中文(简体)
某些部件看不见时使用框架。
原标题:Using frame.pack() when some components are invisible?

I m trying to create a simple Border layout template and I m using frame.pack() to determine frame size. I have an invisible label in the centre region and the pack method doesn t seem to be taking the label into account so it doesn t show. I know it does work initially because the frame is initially the right size for the other components. So how can I get the frame to take the invisible label into account? The label is only visible when the button in the centre region is selected. Everything works, apart from you have to manually increase the frame size to see the label.

问题回答

我认为,这取决于装有标签的集装箱的排位管理人。 一些非专业管理人员仅根据可见的构成部分计算出优先的规模,而另一些人则考虑无形的组成部分。 例如,专家组有<代码>HonorsVisibility方法。

不管怎么说,最容易的办法是在<><>>>后插入“<>>>标签”。

另见SetVisible(false)改变我小组内各组成部分的布局:





相关问题
auto abbreviating JLabel

Anyone written a JLabel (extension/util/??) that automatically abbreviates the contents depending on it s preferred/visible size? much appreciated.

how can install swing/matisse on eclipse?

i tried this link: http://downloads.myeclipseide.com/downloads/products/eworkbench/discovery-6.0/ but i m fail how is this?

Java JTextField with input hint

I would like to add a hint value to my javax.swing.JTextField. It should look like Firefox rendering of <input type="text" title="bla">. This creates an edit field with the text bla in the ...

Swing Generator

I need to develop some java gui using swing. A few years ago I did develop a bit with swing. But it was pretty exhausting, you see, back than there weren t much tools to help you. But I do believe ...

Create a ImageIcon that is the mirror of another one

I ll like to know if there is a way to create a ImageIcon that is the mirror of another ImageIcon. Searching on Google, I found how to do it by using many AWT libraries. Is there a way to do it with ...

热门标签