Java Reference
In-Depth Information
Useful Methods of File Objects
Method
Description
Deletes the given file
delete()
Indicates whether this file exists on the system
exists()
Returns the full path specifying the location of this file
getAbsolutePath()
Returns the name of this file as a String , without any path attached
getName()
Indicates whether this file represents a directory/folder on the system
isDirectory()
Indicates whether this file represents a file (nonfolder) on the system
isFile()
Returns the number of characters in this file
length()
Creates the directory represented by this file, if it does not exist
mkdirs()
Changes this file's name to be the given file's name
renameTo(file)
Useful Methods of Graphics Objects
Method
Description
Draws a line between the points ( x1, y1 ) and
( x2, y2 )
drawLine(x1, y1, x2, y2)
Draws the outline of the largest oval that fits within
the specified rectangle
drawOval(x, y, width, height)
Draws the outline of the specified rectangle
drawRect(x, y, width, height)
Draws the given text with its lower-left corner at
( x, y )
drawString(message, x, y)
Fills the largest oval that fits within the specified
rectangle using the current color
fillOval(x, y, width, height)
Fills the specified rectangle using the current color
fillRect(x, y, width, height)
Sets this graphics context's current color to the
specified color (all subsequent graphics operations
using this graphics context use this specified color)
setColor(color)
Sets this graphics context's current font to the
specified font (all subsequent strings drawn using
this graphics context use this specified font)
setFont(font)
 
 
Search WWH ::




Custom Search