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


Java CheckboxPeer类代码示例

本文整理汇总了Java中java.awt.peer.CheckboxPeer的典型用法代码示例。如果您正苦于以下问题:Java CheckboxPeer类的具体用法?Java CheckboxPeer怎么用?Java CheckboxPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setLabel

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
 * Sets this check box's label to be the string argument.
 *
 * @param    label   a string to set as the new label, or
 *                        <code>null</code> for no label.
 * @see      #getLabel
 */
public void setLabel(String label) {
    boolean testvalid = false;

    synchronized (this) {
        if (label != this.label && (this.label == null ||
                                    !this.label.equals(label))) {
            this.label = label;
            CheckboxPeer peer = (CheckboxPeer)this.peer;
            if (peer != null) {
                peer.setLabel(label);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Checkbox.java

示例2: setLabel

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
 * Sets this check box's label to be the string argument.
 *
 * @param    label   a string to set as the new label, or
 *                        {@code null} for no label.
 * @see      #getLabel
 */
public void setLabel(String label) {
    boolean testvalid = false;

    synchronized (this) {
        if (label != this.label && (this.label == null ||
                                    !this.label.equals(label))) {
            this.label = label;
            CheckboxPeer peer = (CheckboxPeer)this.peer;
            if (peer != null) {
                peer.setLabel(label);
            }
            testvalid = true;
        }
    }

    // This could change the preferred size of the Component.
    if (testvalid) {
        invalidateIfValid();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:Checkbox.java

示例3: setLabel

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
    * Sets this check box's label to be the string argument.
    *
    * @param    label   a string to set as the new label, or
    *                        <code>null</code> for no label.
    * @see      #getLabel
    */
   public void setLabel(String label) {
       boolean testvalid = false;

synchronized (this) {
    if (label != this.label && (this.label == null ||
				!this.label.equals(label))) {
        this.label = label;
	CheckboxPeer peer = (CheckboxPeer)this.peer;
	if (peer != null) {
	    peer.setLabel(label);
	}
	testvalid = true;
    }
}
    
// This could change the preferred size of the Component.
if (testvalid && valid) {
    invalidate();
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:28,代码来源:Checkbox.java

示例4: attachFakePeer

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
public static boolean attachFakePeer(Component comp) {
    if (comp == null || comp.isDisplayable()
          || comp instanceof javax.swing.JComponent
          || comp instanceof javax.swing.RootPaneContainer)
        return false;

    FakePeer peer = null;

    if (comp instanceof Label)
        peer = getFakePeer(LabelPeer.class, new FakeLabelPeer((Label) comp));
    else if (comp instanceof Button)
        peer = getFakePeer(ButtonPeer.class, new FakeButtonPeer((Button) comp));                   
    else if (comp instanceof Panel)
        peer = getFakePeer(new Class[] {ContainerPeer.class, PanelPeer.class}, new FakePanelPeer((Panel) comp));
    else if (comp instanceof TextField)
        peer = getFakePeer(new Class[] {TextFieldPeer.class, TextComponentPeer.class}, new FakeTextFieldPeer((TextField) comp));
    else if (comp instanceof TextArea)
        peer = getFakePeer(new Class[] {TextAreaPeer.class, TextComponentPeer.class}, new FakeTextAreaPeer((TextArea) comp));
    else if (comp instanceof TextComponent)
        peer = getFakePeer(TextComponentPeer.class, new FakeTextComponentPeer((TextComponent) comp));
    else if (comp instanceof Checkbox)
        peer = getFakePeer(CheckboxPeer.class, new FakeCheckboxPeer((Checkbox) comp));
    else if (comp instanceof Choice)
        peer = getFakePeer(ChoicePeer.class, new FakeChoicePeer((Choice) comp));
    else if (comp instanceof List)
        peer = getFakePeer(ListPeer.class, new FakeListPeer((List) comp));
    else if (comp instanceof Scrollbar)
        peer = getFakePeer(ScrollbarPeer.class, new FakeScrollbarPeer((Scrollbar) comp));
    else if (comp instanceof ScrollPane)
        peer = getFakePeer(new Class[] {ContainerPeer.class, ScrollPanePeer.class}, new FakeScrollPanePeer((ScrollPane) comp));
    else if (comp instanceof Canvas)
        peer = getFakePeer(CanvasPeer.class, new FakeCanvasPeer((Canvas) comp));
    else
        return false;

    attachFakePeer(comp, peer);
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:FakePeerSupport.java

示例5: createCheckbox

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
protected CheckboxPeer createCheckbox(Checkbox target) throws HeadlessException {
    throw new IllegalStateException("Method not implemented");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:UtilitiesTest.java

示例6: setStateInternal

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
 * Helper function for setState and CheckboxGroup.setSelectedCheckbox
 * Should remain package-private.
 */
void setStateInternal(boolean state) {
    this.state = state;
    CheckboxPeer peer = (CheckboxPeer)this.peer;
    if (peer != null) {
        peer.setState(state);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:Checkbox.java

示例7: test

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
void test() {
    setState(getState());
    ((CheckboxPeer) getPeer()).setState(getState());

    setCheckboxGroup(getCheckboxGroup());
    ((CheckboxPeer) getPeer()).setCheckboxGroup(getCheckboxGroup());

    setLabel("");
    setLabel(null);
    setLabel(getLabel());
    ((CheckboxPeer) getPeer()).setLabel("");
    ((CheckboxPeer) getPeer()).setLabel(null);
    ((CheckboxPeer) getPeer()).setLabel(getLabel());

    setFont(null);
    setFont(getFont());
    getPeer().setFont(getFont());

    setBackground(null);
    setBackground(getBackground());
    getPeer().setBackground(getBackground());

    setForeground(null);
    setForeground(getForeground());
    getPeer().setForeground(getForeground());

    setEnabled(isEnabled());
    getPeer().setEnabled(isEnabled());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:30,代码来源:CheckboxRepaint.java

示例8: setLabel

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
  * Sets the label for this checkbox to the specified value.
  *
  * @param label The new checkbox label.
  */
public synchronized void
setLabel(String label)
{
  this.label = label;
  if (peer != null)
    {
      CheckboxPeer cp = (CheckboxPeer) peer;
      cp.setLabel(label);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:Checkbox.java

示例9: setState

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
  * Sets the state of this checkbox to the specified value.
  *
  * @param state The new state of the checkbox, which will be <code>true</code>
  * for on or <code>false</code> for off.
  */
public synchronized void
setState(boolean state)
{
  if (this.state != state)
    {
      this.state = state;
      if (peer != null)
        {
          CheckboxPeer cp = (CheckboxPeer) peer;
          cp.setState (state);
        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:Checkbox.java

示例10: setCheckboxGroup

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
  * Sets this object's checkbox group to the specified group.
  *
  * @param group The new checkbox group, or <code>null</code> to make this
  * object part of no checkbox group.
  */
public synchronized void
setCheckboxGroup(CheckboxGroup group)
{
  this.group = group;
  if (peer != null)
    {
      CheckboxPeer cp = (CheckboxPeer) peer;
      cp.setCheckboxGroup (group);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:Checkbox.java

示例11: createCheckbox

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
protected CheckboxPeer createCheckbox(Checkbox target)
{
  checkHeadLess("No CheckboxPeer can be created in an headless graphics " +
                "environment.");

  return new SwingCheckboxPeer(target);
}
 
开发者ID:vilie,项目名称:javify,代码行数:8,代码来源:XToolkit.java

示例12: setState

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
  * Sets the state of this checkbox to the specified value.
  *
  * @param state The new state of the checkbox, which will be <code>true</code>
  * for on or <code>false</code> for off.
  */
public synchronized void
setState(boolean state)
{
  if (this.state != state)
    {
      this.state = state;
      if (peer != null)
	{
	  CheckboxPeer cp = (CheckboxPeer) peer;
	  cp.setState (state);
	}
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:20,代码来源:Checkbox.java

示例13: createCheckbox

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
protected CheckboxPeer createCheckbox(Checkbox target)
{
  checkHeadLess("No CheckboxPeer can be created in an headless graphics " +
                "environment.");
  
  return new SwingCheckboxPeer(target);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:8,代码来源:XToolkit.java

示例14: setStateInternal

import java.awt.peer.CheckboxPeer; //导入依赖的package包/类
/**
    * Helper function for setState and CheckboxGroup.setSelectedCheckbox
    * Should remain package-private.
    */
   void setStateInternal(boolean state) {
this.state = state;
CheckboxPeer peer = (CheckboxPeer)this.peer;
if (peer != null) {
    peer.setState(state);
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:12,代码来源:Checkbox.java


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