当前位置: 首页>>代码示例>>Java>>正文


Java Widget.setBackground方法代码示例

本文整理汇总了Java中org.netbeans.api.visual.widget.Widget.setBackground方法的典型用法代码示例。如果您正苦于以下问题:Java Widget.setBackground方法的具体用法?Java Widget.setBackground怎么用?Java Widget.setBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.visual.widget.Widget的用法示例。


在下文中一共展示了Widget.setBackground方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testLayerPreferredLocation

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void testLayerPreferredLocation () {
    Scene scene = new Scene ();

    scene.addChild (new LayerWidget (scene));

    LayerWidget layer = new LayerWidget (scene);
    layer.setPreferredLocation (new Point (100, 100));
    scene.addChild (layer);

    Widget widget = new Widget (scene);
    widget.setPreferredBounds (new Rectangle (-20, -10, 100, 50));
    widget.setOpaque (true);
    widget.setBackground (Color.RED);
    layer.addChild (widget);

    Color color = (Color) (new DefaultLookFeel()).getBackground();
    assertScene (scene, color, new Rectangle (80, 90, 100, 50));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:LayerWidget103528Test.java

示例2: installUI

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void installUI (VMDNodeWidget widget) {
    widget.setBorder (VMDFactory.createVMDNodeBorder ());
    widget.setOpaque (false);

    Widget header = widget.getHeader ();
    header.setBorder (BORDER_PIN);
    header.setBackground (COLOR_SELECTED);
    header.setOpaque (false);

    Widget minimize = widget.getMinimizeButton ();
    minimize.setBorder (BORDER_MINIMIZE);

    Widget pinsSeparator = widget.getPinsSeparator ();
    pinsSeparator.setForeground (BORDER_CATEGORY_BACKGROUND);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VMDOriginalColorScheme.java

示例3: installUI

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void installUI (VMDNodeWidget widget) {
    widget.setBorder (BORDER60);

    Widget header = widget.getHeader ();
    header.setBackground (COLOR60_HOVER_BACKGROUND);
    header.setBorder (VMDOriginalColorScheme.BORDER_PIN);

    Widget pinsSeparator = widget.getPinsSeparator ();
    pinsSeparator.setForeground (VMDOriginalColorScheme.BORDER_CATEGORY_BACKGROUND);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:VMDNetBeans60ColorScheme.java

示例4: testFlowLayoutInsets

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void testFlowLayoutInsets () {
    Scene scene = new Scene ();
    Widget parent = new Widget (scene);
    parent.setBorder (BorderFactory.createResizeBorder (10));
    parent.setLayout (LayoutFactory.createVerticalFlowLayout ());
    scene.addChild (parent);

    Widget child = new Widget (scene);
    child.setBackground (Color.BLUE);
    child.setOpaque (true);
    child.setPreferredBounds (new Rectangle (-50, -30, 30, 20));
    parent.addChild (child);

    assertScene (scene, Color.WHITE, new Rectangle (-1, -1, 52, 42));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:FlowLayout105400Test.java

示例5: unsetHovering

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void unsetHovering(Widget widget) {
    widget.setBackground(Color.WHITE);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:QBGraphScene.java

示例6: setHovering

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void setHovering(Widget widget) {
    widget.setBackground(Color.CYAN);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:QBGraphScene.java


注:本文中的org.netbeans.api.visual.widget.Widget.setBackground方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。