/*
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package java.awt;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Vector;
import java.util.Locale;
import java.util.EventListener;
import java.util.Iterator;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Collections;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.LightweightPeer;
import java.awt.image.BufferStrategy;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.ColorModel;
import java.awt.image.VolatileImage;
import java.awt.event.*;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceContext;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.InvalidDnDOperationException;
import java.io.Serializable;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.awt.event.InputMethodListener;
import java.awt.event.InputMethodEvent;
import java.awt.im.InputContext;
import java.awt.im.InputMethodRequests;
import java.awt.dnd.DropTarget;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.accessibility.*;
import java.awt.GraphicsConfiguration;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.AccessControlContext;
import javax.accessibility.*;
import java.lang.ref.*;
import java.util.logging.*;
import java.applet.Applet;
import sun.security.action.GetPropertyAction;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
import sun.awt.ConstrainableGraphics;
import sun.awt.DebugHelper;
import sun.awt.SubRegionShowable;
import sun.awt.WindowClosingListener;
import sun.awt.WindowClosingSupport;
import sun.awt.GlobalCursorManager;
import sun.awt.CausedFocusEvent;
import sun.awt.EmbeddedFrame;
import sun.awt.dnd.SunDropTargetEvent;
import sun.awt.im.CompositionArea;
import sun.awt.image.VSyncedBSManager;
import sun.java2d.SunGraphics2D;
import sun.java2d.SunGraphicsEnvironment;
import sun.java2d.pipe.Region;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
import sun.awt.RequestFocusController;
/**
* A <em>component</em> is an object having a graphical representation
* that can be displayed on the screen and that can interact with the
* user. Examples of components are the buttons, checkboxes, and scrollbars
* of a typical graphical user interface. <p>
* The <code>Component</code> class is the abstract superclass of
* the nonmenu-related Abstract Window Toolkit components. Class
* <code>Component</code> can also be extended directly to create a
* lightweight component. A lightweight component is a component that is
* not associated with a native opaque window.
* <p>
* <h3>Serialization</h3>
* It is important to note that only AWT listeners which conform
* to the <code>Serializable</code> protocol will be saved when
* the object is stored. If an AWT object has listeners that
* aren't marked serializable, they will be dropped at
* <code>writeObject</code> time. Developers will need, as always,
* to consider the implications of making an object serializable.
* One situation to watch out for is this:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
* import java.io.Serializable;
*
* class MyApp implements ActionListener, Serializable
* {
* BigObjectThatShouldNotBeSerializedWithAButton bigOne;
* Button aButton = new Button();
*
* MyApp()
* {
* // Oops, now aButton has a listener with a reference
* // to bigOne!
* aButton.addActionListener(this);
* }
*
* public void actionPerformed(ActionEvent e)
* {
* System.out.println("Hello There");
* }
* }
* </pre>
* In this example, serializing <code>aButton</code> by itself
* will cause <code>MyApp</code> and everything it refers to
* to be serialized as well. The problem is that the listener
* is serializable by coincidence, not by design. To separate
* the decisions about <code>MyApp</code> and the
* <code>ActionListener</code> being serializable one can use a
* nested class, as in the following example:
* <pre>
* import java.awt.*;
* import java.awt.event.*;
* import java.io.Serializable;
*
* class MyApp java.io.Serializable
* {
* BigObjectThatShouldNotBeSerializedWithAButton bigOne;
* Button aButton = new Button();
*
* static class MyActionListener implements ActionListener
* {
* public void actionPerformed(ActionEvent e)
* {
* System.out.println("Hello There");
* }
* }
*
* MyApp()
* {
* aButton.addActionListener(new MyActionListener());
* }
* }
* </pre>
* <p>
* <b>Note</b>: For more information on the paint mechanisms utilitized
* by AWT and Swing, including information on how to write the most
* efficient painting code, see
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
* <p>
* For details on the focus subsystem, see
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
* How to Use the Focus Subsystem</a>,
* a section in <em>The Java Tutorial</em>, and the
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
* for more information.
*
* @version %I%, %G%
* @author Arthur van Hoff
* @author Sami Shaio
*/
public abstract class Component implements ImageObserver, MenuContainer,
Serializable
{
private static final Logger focusLog = Logger.getLogger("java.awt.focus.Component");
private static final Logger log = Logger.getLogger("java.awt.Component");
private static final Logger mixingLog = Logger.getLogger("java.awt.mixing.Component");
/**
* The peer of the component. The peer implements the component's
* behavior. The peer is set when the <code>Component</code> is
* added to a container that also is a peer.
* @see #addNotify
* @see #removeNotify
*/
transient ComponentPeer peer;
/**
* The parent of the object. It may be <code>null</code>
* for top-level components.
* @see #getParent
*/
transient Container parent;
/**
* The <code>AppContext</code> of the component. Applets/Plugin may
* change the AppContext.
*/
transient AppContext appContext;
/**
* The x position of the component in the parent's coordinate system.
*
* @serial
* @see #getLocation
*/
int x;
/**
* The y position of the component in the parent's coordinate system.
*
* @serial
* @see #getLocation
*/
int y;
/**
* The width of the component.
*
* @serial
* @see #getSize
*/
int width;
/**
* The height of the component.
*
* @serial
* @see #getSize
*/
int height;
/**
* The foreground color for this component.
* <code>foreground</code> can be <code>null</code>.
*
* @serial
* @see #getForeground
* @see #setForeground
*/
Color foreground;
/**
* The background color for this component.
* <code>background</code> can be <code>null</code>.
*
* @serial
* @see #getBackground
* @see #setBackground
*/
Color background;
/**
* The font used by this component.
没有合适的资源?快使用搜索试试~ 我知道了~
java JDK1.6.0_41 源码
共7172个文件
java:7158个
h:7个
c:7个
5星 · 超过95%的资源 需积分: 10 63 下载量 77 浏览量
2013-07-24
14:11:25
上传
评论 3
收藏 18.08MB ZIP 举报
温馨提示
java JDK的源码,提供给程序员查看java语言基本API的实现方式。有利于程序员更好的掌握Java语言。使用方法如下: 1.点 “window”-> "Preferences" -> "Java" -> "Installed JRES" 2.此时"Installed JRES"右边是列表窗格,列出了系统中的 JRE 环境,选择你的JRE,然后点边上的 "Edit...", 会出现一个窗口(Edit JRE) 3.选中rt.jar文件的这一项:“c:\program files\java\jre_1.5.0_06\lib\rt.jar” 点 左边的“+” 号展开它, 4.展开后,可以看到“Source Attachment:(none)”,点这一项,点右边的按钮“Source Attachment...”, 选择你的JDK目录下的 “src.zip”文件 5.一路点"ok",结束。
资源推荐
资源详情
资源评论
收起资源包目录
java JDK1.6.0_41 源码 (7172个子文件)
java.c 61KB
java_md.c 51KB
parse_manifest.c 17KB
wildcard.c 12KB
version_comp.c 9KB
splashscreen_stubs.c 2KB
jli_util.c 1KB
manifest_info.h 5KB
java.h 2KB
java_md.h 1KB
version_comp.h 482B
splashscreen.h 434B
wildcard.h 388B
jli_util.h 366B
Component.java 363KB
JTable.java 353KB
ORBUtilSystemException.java 326KB
Character.java 212KB
BaseRowSet.java 210KB
XPathParser.java 203KB
JComponent.java 194KB
ResultSet.java 192KB
JTree.java 186KB
NimbusDefaults.java 185KB
Pattern.java 183KB
JTextComponent.java 176KB
Container.java 173KB
XMLSchemaValidator.java 172KB
Arrays.java 163KB
Formatter.java 155KB
BigDecimal.java 155KB
DatabaseMetaData.java 150KB
BasicTabbedPaneUI.java 149KB
XMLCipher.java 146KB
BasicTreeUI.java 140KB
GroupLayout.java 139KB
Collections.java 136KB
JList.java 136KB
DecimalFormat.java 135KB
ComponentColorModel.java 131KB
XMLDocumentFragmentScannerImpl.java 131KB
XSDHandler.java 129KB
OMGSystemException.java 129KB
RegularExpression.java 127KB
RelationService.java 127KB
Window.java 127KB
HTMLDocument.java 124KB
AffineTransform.java 124KB
KeyboardFocusManager.java 124KB
Class.java 121KB
XSSimpleTypeDecl.java 119KB
XMLEntityManager.java 118KB
URI.java 116KB
ImageReader.java 115KB
XIncludeHandler.java 115KB
SynthPainterImpl.java 114KB
CallableStatement.java 114KB
WindowsLookAndFeel.java 113KB
String.java 113KB
XSLTErrorResources_ja.java 113KB
ConcurrentSkipListMap.java 111KB
XMLGregorianCalendarImpl.java 111KB
ObjectInputStream.java 110KB
DTDGrammar.java 108KB
ToStream.java 108KB
XSLTErrorResources_ko.java 107KB
BigInteger.java 107KB
StyleSheet.java 107KB
MetalLookAndFeel.java 106KB
Toolkit.java 105KB
JOptionPane.java 104KB
AbstractButton.java 103KB
Font.java 103KB
TextLayout.java 102KB
ResourceBundle.java 101KB
GregorianCalendar.java 101KB
RowSet.java 100KB
AbstractDOMParser.java 100KB
AbstractDocument.java 99KB
XSLTErrorResources_zh_TW.java 99KB
XSLTErrorResources_zh_CN.java 99KB
BasicListUI.java 99KB
CSS.java 98KB
Scanner.java 98KB
RequiredModelMBean.java 97KB
Calendar.java 97KB
Path2D.java 97KB
SynthPainter.java 96KB
XSLTErrorResources_de.java 96KB
CoreDocumentImpl.java 96KB
XSLTErrorResources_fr.java 96KB
IIOPInputStream.java 96KB
XSLTErrorResources_es.java 96KB
JPEGMetadata.java 96KB
X509CertSelector.java 95KB
XSLTErrorResources_it.java 95KB
BasicLookAndFeel.java 94KB
DTMDocumentImpl.java 93KB
ParsedSynthStyle.java 92KB
XSAttributeChecker.java 92KB
共 7172 条
- 1
- 2
- 3
- 4
- 5
- 6
- 72
螃蟹变异了
- 粉丝: 12
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 所有算法均用 Python 实现.zip
- redis-standalone.yml redis k8s单点部署
- Python基于Scrapy兼职招聘网站爬虫数据分析设计(源码)
- zipkin.yml zipkin k8s部署
- YY9706.102-2021医用电气设备第2-47部分
- 通过运用时间序列ARIMA模型与循环神经网络(LSTM)对中国包装机器数量进行预测(python源码)
- Ruby编程基础与进阶指南
- 基于ARIMA模型的股票预测(python源码)
- 基于阿里云对象存储的对文件进行批量修改、批量解冻、批量上传
- 山东联通-海信IP501H-GK6323V100C-1+8G-4.4.2-当贝桌面-卡刷包
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页