本文整理汇总了Java中java.awt.Component.isOpaque方法的典型用法代码示例。如果您正苦于以下问题:Java Component.isOpaque方法的具体用法?Java Component.isOpaque怎么用?Java Component.isOpaque使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Component
的用法示例。
在下文中一共展示了Component.isOpaque方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isOpaque
import java.awt.Component; //导入方法依赖的package包/类
@Override
public boolean isOpaque () {
Color back = getBackground ();
Component p = getParent ();
if (p != null) {
p = p.getParent ();
}
// p should now be the JList.
boolean colorMatch = (back != null) && (p != null) &&
back.equals (p.getBackground ()) &&
p.isOpaque ();
return !colorMatch && super.isOpaque ();
}
示例2: isOpaque
import java.awt.Component; //导入方法依赖的package包/类
/**
* Overridden for performance reasons.
*/
@Override
public boolean isOpaque() {
Color back = getBackground();
Component p = getParent();
if(p != null) {
p = p.getParent();
}
// p should now be the JTable.
boolean colorMatch = (back != null) && (p != null)
&& back.equals(p.getBackground()) && p.isOpaque();
return !colorMatch && super.isOpaque();
}
示例3: setOpaqueLayerRecursive
import java.awt.Component; //导入方法依赖的package包/类
private static void setOpaqueLayerRecursive(Component opaqueComponent) {
if (opaqueComponent instanceof JTextArea ||
opaqueComponent instanceof JLabel) {
if (opaqueComponent.isOpaque()) {
((JComponent) opaqueComponent).setOpaque(false);
}
} else if (opaqueComponent instanceof JPanel) {
JComponent panel = (JComponent)opaqueComponent;
if (panel.isOpaque()) {
panel.setOpaque(false);
}
iterateOverOpaqueLayersComponents(panel);
}
}
示例4: isOpaque
import java.awt.Component; //导入方法依赖的package包/类
/**
* Overridden for performance reasons.
* See the <a href="#override">Implementation Note</a>
* for more information.
*/
public boolean isOpaque() {
Color back = getBackground();
Component p = getParent();
if (p != null) {
p = p.getParent();
}
// p should now be the JTable.
boolean colorMatch = (back != null) && (p != null) &&
back.equals(p.getBackground()) &&
p.isOpaque();
return !colorMatch && super.isOpaque();
}
示例5: isOpaque
import java.awt.Component; //导入方法依赖的package包/类
/**
* Overridden for performance reasons.
* See the <a href="#override">Implementation Note</a>
* for more information.
*
* @since 1.5
* @return <code>true</code> if the background is completely opaque
* and differs from the JList's background;
* <code>false</code> otherwise
*/
@Override
public boolean isOpaque() {
Color back = getBackground();
Component p = getParent();
if (p != null) {
p = p.getParent();
}
// p should now be the JList.
boolean colorMatch = (back != null) && (p != null) &&
back.equals(p.getBackground()) &&
p.isOpaque();
return !colorMatch && super.isOpaque();
}