English 中文(简体)
JLayeredPane诉法国 集装箱层
原标题:JLayeredPane versus Container layering
  • 时间:2011-01-13 15:41:32
  •  标签:
  • java
  • swing

http://download.oracle.com/javase/6/docs/api/javax/swing/JLayeredPane.html> rel=“noreferer”>J LayeredPane 允许一人打多个 to http://download.oracle.com/javase/6/docs/api/java/awt/Container.html#add%28java.awt.Component,%20java.lang.Object%29"rel=“noretinger”>J LayeredPane.add(Component, Integer)。 较高“支出者”的构成部分在较低“支出者”的构成部分上显示。

Container.add(Component, int) provides a similar mechanism whereby Components with lower indexes display on top of Components with higher indexes.

请注意,第一个机制使用Integer,第二个机制使用int。 而且,人们将高价值置于低价值之上,而后者则相反。 不要混淆这两条:

我的问题是:在集装箱已经提供同样的机制时,使用JLayeredPane的点是什么? 一个层次的成分是否比另一个层次更好?

UPDATE: There is also Container.setComponentZOrder(Component, int) to consider.

最佳回答
问题回答

我就此认为,<代码>Container.add(Component,int)和J LayeredPane.add(Component,Integer)的职能将这一构成部分列入某一指数。 当时,这一指数被编外管理人员用来处理该部分的位置、布局和油漆顺序。 我想J LayeredPane.set Layer(Component c, int上层)是你从一层到一层的。 专用于各组成部分。 就我而言,我有两个意思。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签