📄 appendix-b.html
字号:
WINDOW_MOVED
// methods
public boolean controlDown()
public boolean metaDown()
public boolean shiftDown()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.awt.Frame</I></B></FONT></P>
<P>A Frame provides a separate, resizable, iconifiable window with a title and menu bar.
</P>
<!-- CODE //-->
<PRE>
// constructors
public Frame()
public Frame(String title)
// public constants for cursor types
public final static int CROSSHAIR_CURSOR,
DEFAULT_CURSOR,
E_RESIZE_CURSOR,
HAND_CURSOR ,
MOVE_CURSOR ,
NE_RESIZE_CURSOR ,
NW_RESIZE_CURSOR ,
N_RESIZE_CURSOR ,
SE_RESIZE_CURSOR ,
SW_RESIZE_CURSOR ,
S_RESIZE_CURSOR,
TEXT_CURSOR,
WAIT_CURSOR ,
W_RESIZE_CURSOR
// methods
public synchronized void dispose()
public int getCursorType()
public Image getIconImage()
public MenuBar getMenuBar()
public String getTitle()
public boolean isResizable()
public synchronized void pack() // inherited from Window
public void setCursor(int cursorType)
public void setIconImage(Image image)
public synchronized void setMenuBar(MenuBar mb)
public void setResizable(boolean b)
public void setTitle(String title)
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.awt.Graphics</I></B></FONT></P>
<P>This abstract class declares many of the methods you’ll use in creating graphics for games. You can obtain a Graphics object with the Component method getGraphics(); alternatively, override the Component method paint(Graphics g).
</P>
<!-- CODE //-->
<PRE>
public abstract void clearRect(int x, int y, int width, int height)
public abstract void clipRect(int x, int y, int width, int height)
public abstract void copyArea(int x, int y, int width, int height, ⇐
int dx, int dy)
public abstract Graphics create()
Graphics create(int x, int y, int width, int height)
public abstract void dispose()
public void draw3DRect(int x, int y, int width, int height, boolean
raised)
public abstract void drawArc(int x, int y, int width, int height, int
startAngle, int arcAngle)
public void drawBytes(byte data[], int offset, int length, int x, int y)
public void drawChars(char data[], int offset, int length, int x, int y)
public abstract boolean drawImage(Image img, int x, int y, int width, ⇐
int height, ImageObserver obs)
public abstract boolean drawImage(Image img, int x, int y, int width, ⇐
int height, Color bkgColor, ImageObserver observer)
public abstract void drawLine(int x1, int y1, int x2, int y2)
public abstract void drawOval(int x, int y, int width, int height)
public abstract void drawPolygon(int xPoints[], int yPoints[], int
nPoints)
public void drawPolygon(Polygon polygon)
public void drawRect(int x, int y, int width, int height)
public abstract void drawRoundRect(int x, int y, int width, int height, ⇐
int arcWidth, int arcHeight)
public abstract void drawString(String str, int x, int y)
public void fill3DRect(int x, int y, int width, int height, boolean
raised)
public abstract void fillArc(int x, int y, int width, int height, int
startAngle, int arcAngle)
public abstract void fillOval(int x, int y, int width, int height)
public abstract void fillPolygon(int xPoints[], int yPoints[], int
nPoints)
public void fillPolygon(Polygon polygon)
public abstract void fillRect(int x, int y, int width, int height)
public abstract void fillRoundRect(int x, int y, int width, int height, ⇐
int arcWidth, int arcHeight)
public void finalize()
public abstract Rectangle getClipRect()
public abstract Color getColor()
public abstract Font getFont()
public FontMetrics getFontMetrics()
public abstract FontMetrics getFontMetrics(Font font)
public abstract void setColor(Color color)
public abstract void setFont(Font font)
public abstract void setPaintMode()
public abstract void setXORMode(Color color)
public String toString()
public abstract void translate(int x, int y)
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.awt.Image</I></B></FONT></P>
<P>Image is an abstract class that encapsulates a bitmap image.
</P>
<!-- CODE SNIP //-->
<PRE>
public abstract void flush()
public abstract Graphics getGraphics()
public abstract int getHeight(ImageObserver observer)
public abstract Object getProperty(String name, ImageObserver observer)
public abstract ImageProducer getSource()
public abstract int getWidth(ImageObserver observer)
</PRE>
<!-- END CODE SNIP //-->
<P><FONT SIZE="+1"><B><I>java.awt.MediaTracker</I></B></FONT></P>
<P>A MediaTracker object loads and tracks images. Use it to load bitmaps into game applets.
</P>
<!-- CODE //-->
<PRE>
// constructor
public MediaTracker(Component comp)
// public constants
public final static int ABORTED, COMPLETE, ERRORED, LOADING
// public instance methods
public void addImage(Image image,int id)
public void addImage(Image image,int id,int w,int h)
public boolean checkAll()
public boolean checkId(int id)
public synchronized Object[] getErrorsAny()
public synchronized Object[] getErrorsID(int id)
public synchronized boolean isErrorAny()
public synchronized boolean isErrorID(int id)
public int statusAll(boolean load)
public int statusID(int id,boolean load)
public void waitForAll() throws InterruptedException
public void waitForId(int id) throws InterruptedException
</PRE>
<!-- END CODE //-->
<P><B>The java.lang Package</B></P>
<P>The java.lang package contains the fundamental classes of the Java language.
</P>
<P><FONT SIZE="+1"><B><I>java.lang.Boolean</I></B></FONT></P>
<P>This is a wrapper class for the boolean primitive type.
</P>
<!-- CODE //-->
<PRE>
// constructors
public Boolean(boolean state)
public Boolean(String state)
// public constants
public final static Boolean TRUE, FALSE
// public static methods
public static boolean getBoolean(String propName)
public static Boolean valueOf(String str)
// public instance methods
public boolean booleanValue()
public boolean equals(Object obj)
public int hashCode()
public String toString()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.lang.Character</I></B></FONT></P>
<P>This is a wrapper class for the char primitive type.
</P>
<!-- CODE //-->
<PRE>
// constructor
public Character(char value)
// public constants
public final static int MIN_RADIX, MAX_RADIX
// public static methods
public static int digit(char ch, int radix)
public static char forDigit(int digit, int radix)
public static boolean isDigit(char ch)
public static boolean isLowerCase(char ch)
public static boolean isSpace(char ch)
public static boolean isUpperCase(char ch)
public static char toLowerCase(char ch)
public static char toUpperCase(char ch)
// public instance methods
public char charValue()
public boolean equals(Object obj)
public int hashCode()
public String toString()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.lang.Class</I></B></FONT></P>
<P>The Class class defines methods that return information about a class, such as its name (getName()), its superclass (getSuperClass()), and the interfaces that the class implements (getInterfaces()). In addition, you can dynamically create an object of the class, using the newInstance() method. The forName() method returns a Class object from the fully qualified name of a class or object.
</P>
<!-- CODE //-->
<PRE>
// public static methods
public static Class forName(String className) throws ⇐
ClassNotFoundException
// public instance methods
public ClassLoader getClassLoader()
public Class[] getInterfaces()
public String getName()
public Class getSuperClass()
public boolean isInterface()
public Object newInstance() throws InstantiationException,
ClassNotFoundException
public String toString()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.lang.Cloneable (Interface)</I></B></FONT></P>
<P>If a class implements the Cloneable interface, instances of the class may be cloned using the Object method clone(). No variables or methods are declared by this interface.
</P>
<P><FONT SIZE="+1"><B><I>java.lang.Double</I></B></FONT></P>
<P>This is a wrapper class for the double primitive type.
</P>
<!-- CODE //-->
<PRE>
// constructors
public Double(double value)
public Double(String s) throws NumberFormatException
// public constants
public final static double MIN_VALUE
public final static double MAX_VALUE
public final static double NEGATIVE_INFINITY
public final static double NaN
public final static double POSITIVE_INFINITY
// public static methods
public static long doubleToLongBits(double valToConvert)
public static boolean isInfinite(double valToTest)
public static boolean isNaN(double valToTest)
public static double longBitsToDouble(long bitsToConvert)
public static String toString(double d)
public static Double valueOf(String str) throws NumberFormatException
// public instance methods
public double doubleValue()
public boolean equals(Object obj)
public float floatValue()
public int hashCode()
public int intValue()
public boolean isInfinite()
public boolean isNaN()
public long longValue()
public String toString()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.lang.Float</I></B></FONT></P>
<P>This is a wrapper class for the float primitive type.
</P>
<!-- CODE //-->
<PRE>
// constructors
public Float(float value)
public Float(double value)
public Float(String s) throws NumberFormatException
// public constants
public final static float MIN_VALUE
public final static float MAX_VALUE
public final static float NEGATIVE_INFINITY
public final static float NaN
public final static float POSITIVE_INFINITY
// public static methods
public static long floatToIntBits(float valToConvert)
public static float intBitsToFloat(int bitsToConvert)
public static boolean isInfinite(double valToTest)
public static boolean isNaN(double valToTest)
public static String toString(float f)
public static String toString(float val)
public static Float valueOf(String str) throws NumberFormatException
// public instance methods
public double doubleValue()
public boolean equals(Object obj)
public float floatValue()
public int hashCode()
public int intValue()
public boolean isInfinite()
public boolean isNaN()
public long longValue()
public String toString()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.lang.Integer</I></B></FONT></P>
<P>This is a wrapper class for the int primitive type.
</P>
<!-- CODE //-->
<PRE>
// constructors
public Integer(int value)
public Integer(String s) throws NumberFormatException
// public constants
public final static int MIN_VALUE
public final static int MAX_VALUE
// public static methods
public static Integer getInteger(String propName)
public static Integer getInteger(String propName, int val)
public static Integer getInteger(String propName, Integer val)
public static int parseInt(String str) throws NumberFormatException
public static int parseInt(String str,int radix) throws
NumberFormatException
public static Integer valueOf(String str, int radix) throws
NumberFormatException
public static Integer valueOf(String str) throws NumberFormatException
// public instance methods
public double doubleValue()
public boolean equals(Object obj)
public float floatValue()
public int hashCode()
public int intValue()
public long longValue()
public String toString()
public String toString(int I)
public String toString(int i, int radix)
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.lang.Long</I></B></FONT></P>
<P>This is a wrapper class for the long primitive type.
</P>
<!-- CODE //-->
<PRE>
// constructors
public Long(long value)
public Long(String str)
// public constants
public final static long MIN_VALUE
public final static long MAX_VALUE
// public static methods
public static Long getLong(String propName)
public static Long getLong(String propName, long val)
public static Long getLong(String propName, Long val)
public static long parseLong(String str) throws ⇐
NumberFormatException
public static long parseLong(String str,int radix) throws
NumberFormatException
public static String toString(int i)
public static String toString(int i, int radix)
public static Long valueOf(String str, int radix) throws
NumberFormatException
public static Long valueOf(String str) throws NumberFormatException
// public instance methods
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -