Java Programing laungage

J2ME Projects

J2ME Project 1

adplus-dvertising
Package of J2ME
Previous Home Next

Define package javax.microedition.midlet.MIDlet

javax.microedition.midlet.MIDlet class

ConstructorDescription
protected MIDlet()constructor for subclasses.

MethodDescription
protected abstract void destroyApp(boolean unconditional)Signals the MIDlet to terminate and enter the Destroyed state.
protected abstract void pauseApp() Signals the MIDlet to enter the Paused state.
protected abstract void startApp() Signals the MIDlet that it has entered the Active state.
public final boolean platformRequest(String URL)Requests that the device handle (for example, display or install) the indicated URL.
public final int checkPermission(String permission)Get the status of the specified permission.
public final String getAppProperty(String key)Provides a MIDlet with a mechanism to retrieve named properties from the application management software.
public final void notifyDestroyed() Used by an MIDlet to notify the application management software that it has entered into the Destroyed state.
public final void notifyPaused() Notifies the application management software that the MIDlet does not want to be active and has entered the Paused state.
public final void resumeRequest() Provides a MIDlet with a mechanism to indicate that it is interested in entering the Active state.

javax.microedition.midlet.MIDletStateChangeException class

ConstructorDescription
public MIDletStateChangeException() Constructs an exception with no specified detail message.
public MIDletStateChangeException(String s) Constructs an exception with the specified detail message.

Define package javax.microedition.lcdui.*;

The UI API provides a set of features for implementation of user interfaces for MIDP applications.

javax.microedition.lcdui.Alert class

ConstructorDescription
public Alert(String title) Constructs a new, empty Alert object with the given title.
public Alert(String title, String alertText, Image alertImage, AlertType alertType)Constructs a new Alert object with the given title, content string and image, and alert type.

MethodDescription
public int getDefaultTimeout() Gets the default time for showing an Alert.
public int getTimeout() Gets the time this Alert will be shown.
public String getString() Gets the text string used in the Alert.
public Gauge getIndicator() Gets the activity indicator for this Alert.
public Image getImage()Gets the Image used in the Alert.
public void addCommand(Command cmd) Adds a command to the Displayable.
public void removeCommand(Command cmd)Removes a command from the Displayable.
public void setCommandListener(CommandListener l)Sets a listener for Commands to this Displayable, replacing any previous CommandListener.
public void setImage(Image img) Sets the Image used in the Alert.
public void setIndicator(Gauge indicator)Sets an activity indicator on this Alert.
public void setString(String str) Sets the text string used in the Alert.
public void setTimeout(int time) Set the time for which the Alert is to be shown.
public void setType(AlertType type) Sets the type of the Alert.

javax.microedition.lcdui.AlertType class

ConstructorDescription
protected AlertType()Protected constructor for subclasses.
MethodDescription
public boolean playSound(Display display)Alert the user by playing the sound for this AlertType.

javax.microedition.lcdui.Canvas class

ConstructorDescription
protected Canvas()Constructs a new Canvas object

MethodDescription
protected abstract void paint(Graphics g) Renders the Canvas.
protected void hideNotify() The implementation calls hideNotify() shortly after the Canvas has been removed from the display.
protected void keyPressed(int keyCode) Called when a key is pressed.
protected void keyReleased(int keyCode)Called when a key is released.
protected void keyRepeated(int keyCode)Called when a key is repeated (held down).
protected void pointerDragged(int x, int y)Called when the pointer is dragged.
protected void pointerPressed(int x, int y)Called when the pointer is pressed.
protected void pointerReleased(int x, int y)Called when the pointer is released.
protected void showNotify()The implementation calls showNotify() immediately prior to this Canvas being made visible on the display.
protected void sizeChanged(int w, int h)Called when the drawable area of the Canvas has been changed.
public boolean hasPointerEvents() Checks if the platform supports pointer press and release events.
public boolean hasPointerMotionEvents() Checks if the platform supports pointer motion events (pointer dragged).
public boolean hasRepeatEvents() Checks if the platform can generate repeat events when key is kept down.
public boolean isDoubleBuffered() Checks if the Canvas is double buffered by the implementation.
public final void repaint() Requests a repaint for the entire Canvas.
public final void repaint(int x, int y, int width, int height)Requests a repaint for the specified region of the Canvas.
public final void serviceRepaints()Forces any pending repaint requests to be serviced immediately.
public int getGameAction(int keyCode)Gets the game action associated with the given key code of the device.
public int getHeight()Gets the height in pixels of the displayable area available to the application
public int getKeyCode(int gameAction)Gets a key code that corresponds to the specified game action on the device.
public int getWidth()Gets the width in pixels of the displayable area available to the application
public String getKeyName(int keyCode)Gets an informative key string for a key.
public void setFullScreenMode(boolean mode) Controls whether the Canvas is in full-screen mode or in normal mode.

javax.microedition.lcdui.ChoiceGroup class

ConstructorDescription
public ChoiceGroup(String label, int choiceType)Creates a new, empty ChoiceGroup, specifying its title and its type.
public ChoiceGroup(String label, int choiceType, String[] stringElements, Image[] imageElements)Creates a new ChoiceGroup, specifying its title, the type of the ChoiceGroup, and an array of Strings and Images to be used as its initial contents.
MethodDescription
public boolean isSelected(int elementNum)Gets a boolean value indicating whether this element is selected.
public int append(String stringPart, Image imagePart)Appends an element to the ChoiceGroup.
public int getFitPolicy() Gets the application's preferred policy for fitting Choice element contents to the available screen space.
public int getSelectedFlags(boolean[] selectedArray_return) Queries the state of a ChoiceGroup and returns the state of all elements in the boolean array selectedArray_return.
public int getSelectedIndex() Returns the index number of an element in the ChoiceGroup that is selected.
public int size()Returns the number of elements in the ChoiceGroup.
public String getString(int elementNum)Gets the String part of the element referenced by elementNum.
public Font getFont(int elementNum) Gets the application's preferred font for rendering the specified element of this Choice.
public Image getImage(int elementNum) Gets the Image part of the element referenced by elementNum.
public void delete(int elementNum)Deletes the element referenced by elementNum.
public void deleteAll() Deletes all elements from this ChoiceGroup.
public void insert(int elementNum, String stringPart, Image imagePart)Inserts an element into the ChoiceGroup just prior to the element specified.
public void set(int elementNum, String stringPart, Image imagePart) Sets the String and Image parts of the element referenced by elementNum, replacing the previous contents of the element.
public void setFitPolicy(int fitPolicy)Sets the application's preferred policy for fitting Choice element contents to the available screen space.
public void setFont(int elementNum, Font font)Sets the application's preferred font for rendering the specified element of this Choice.
public void setSelectedFlags(boolean[] selectedArray) Attempts to set the selected state of every element in the ChoiceGroup.
public void setSelectedIndex(int elementNum, boolean selected)For ChoiceGroup objects of type MULTIPLE, this simply sets an individual element's selected state.

javax.microedition.lcdui.Command class

ConstructorDescription
public Command(String label, int commandType, int priority)Creates a new command object with the given short label, type, and priority.
public Command(String shortLabel, String longLabel, int commandType, int priority)Creates a new command object with the given labels, type, and priority.
MethodDescription
public int getCommandType()Gets the type of the command.
public int getPriority()Gets the priority of the command.
public String getLabel()Gets the short label of the command.
public String getLongLabel() Gets the long label of the command.

javax.microedition.lcdui.CustomItem class

ConstructorDescription
protected CustomItem(String label) Superclass constructor, provided so that the CustomItem subclass can specify its label.
MethodDescription
protected abstract int getMinContentHeight()Implemented by the subclass to return the minimum height of the content area, in pixels.
protected abstract int getMinContentWidth()Implemented by the subclass to return the minimum width of the content area, in pixels.
protected abstract int getPrefContentHeight(int width)Implemented by the subclass to return the preferred height of the content area, in pixels.
protected abstract int getPrefContentWidth(int height)Implemented by the subclass to return the preferred width of the content area, in pixels.
protected abstract void paint(Graphics g, int w, int h)Implemented by the subclass to render the item within its container.
protected boolean traverse(int dir, int viewportWidth, int viewportHeight, int[] visRect_inout)Called by the system when traversal has entered the item or has occurred within the item.
protected final int getInteractionModes()Gets the available interaction modes.
protected final void invalidate() Signals that the CustomItem's size and traversal location need to be updated.
protected final void repaint() Called by subclass code to request that the item be repainted.
protected final void repaint(int x, int y, int w, int h)Called by subclass code to request that the specified rectangular area of the item be repainted.
protected void hideNotify() Called by the system to notify the item that it is now completely invisible, when it previously had been at least partially visible.
protected void keyPressed(int keyCode)Called by the system when a key is pressed.
protected void keyReleased(int keyCode)Called by the system when a key is released.
protected void keyRepeated(int keyCode) Called by the system when a key is repeated.
protected void pointerDragged(int x, int y)Called by the system when a pointer drag action (for example, pen motion after a press but before a release) has occurred within the item.
protected void pointerPressed(int x, int y)Called by the system when a pointer down action (for example, a pen tap) has occurred within the item.
protected void pointerReleased(int x, int y)Called by the system when a pointer up action (for example, a pen lift) has occurred after a pointer down action had occurred within the item.
protected void showNotify() Called by the system to notify the item that it is now at least partially visible, when it previously had been completely invisible
protected void sizeChanged(int w, int h)Implemented by the subclass in order to handle size change events.
protected void traverseOut() Called by the system when traversal has occurred out of the item.
public int getGameAction(int keyCode)Gets the game action associated with the given key code of the device.

javax.microedition.lcdui.DataField class

ConstructorDescription
public DateField(String label, int mode)Creates a DateField object with the specified label and mode.
public DateField(String label, int mode, TimeZone timeZone)Creates a date field in which calendar calculations are based on specific TimeZone object and the default calendaring system for the current locale.
MethodDescription
public int getInputMode()Description
ConstructorGets input mode for this date field.
public Date getDate()Returns date value of this field.
public void setDate(Date date) Sets a new value for this field.
public void setInputMode(int mode) Set input mode for this date field.

javax.microedition.lcdui.Display class

ConstructorDescription
Display()Constructor for subclasses.
MethodDescription
public boolean flashBacklight(int duration)Requests a flashing effect for the device's backlight.
public boolean isColor() Returns one of the colors from the high level user interface color scheme, in the form 0x00RRGGBB based on the colorSpecifier passed in.
public boolean vibrate(int duration) Requests operation of the device's vibrator.
public int getBestImageHeight(int imageType)Returns the best image height for a given image type.
public int getBestImageWidth(int imageType)Returns the best image width for a given image type.
public int getBorderStyle(boolean highlighted)Returns the stroke style used for border drawing depending on the state of the component (highlighted/non-highlighted).
public int getColor(int colorSpecifier) Returns one of the colors from the high level user interface color scheme, in the form 0x00RRGGBB based on the colorSpecifier passed in.
public int numAlphaLevels() Gets the number of alpha transparency levels supported by this implementation.
public int numColors()Gets the number of colors (if isColor() is true) or graylevels (if isColor() is false) that can be represented on the device.
public Displayable getCurrent()Gets the current Displayable object for this MIDlet.
public static Display getDisplay(MIDlet m) Gets the Display object that is unique to this MIDlet.
public void callSerially(Runnable r)Causes the Runnable object r to have its run() method called later, serialized with the event stream, soon after completion of the repaint cycle.
public void setCurrent(Alert alert, Displayable nextDisplayable)Requests that this Alert be made current, and that nextDisplayable be made current after the Alert is dismissed.
public void setCurrent(Displayable nextDisplayable) Requests that a different Displayable object be made visible on the display.
public void setCurrentItem(Item item) Requests that the Displayable that contains this Item be made current, scrolls the Displayable so that this Item is visible, and possibly assigns the focus to this Item.

javax.microedition.lcdui.Displayable class

ConstructorDescription
Displayable()Constructor for subclasses.
MethodDescription
protected void sizeChanged(int w, int h)The implementation calls this method when the available area of the Displayable has been changed.
public boolean isShown()Checks if the Displayable is actually visible on the display
public int getHeight()Gets the height in pixels of the displayable area available to the application.
public int getWidth()Gets the width in pixels of the displayable area available to the application.
public String getTitle()Gets the title of the Displayable.
public Ticker getTicker()Gets the ticker used by this Displayable.
public void addCommand(Command cmd) Adds a command to the Displayable
public void removeCommand(Command cmd)Removes a command from the Displayable.
public void setCommandListener(CommandListener l)Sets a listener for Commands to this Displayable, replacing any previous CommandListener.
public void setTicker(Ticker ticker) Sets a ticker for use with this Displayable, replacing any previous ticker.
public void setTitle(String s) Sets the title of the Displayable

javax.microedition.lcdui.Font class

ConstructorDescription
Font() Constructor for subclasses.
MethodDescription
public boolean isBold()Returns true if the font is bold.
public boolean isItalic()Returns true if the font is italic.
public boolean isPlain()Returns true if the font is plain.
public boolean isUnderlined()Returns true if the font is underlined.
public int charWidth(char ch) Gets the advance width of the specified character in this Font.
public int charsWidth(char[] ch, int offset, int length)Returns the advance width of the characters in ch, starting at the specified offset and for the specified number of characters (length).
public int getBaselinePosition() Gets the distance in pixels from the top of the text to the text's baseline.
public int getFace()Gets the face of the font.
public int getHeight()Gets the standard height of a line of text in this font.
public int getSize()Gets the size of the font.
public int getStyle()Gets the style of the font.
public int stringWidth(String str) Gets the total advance width for showing the specified String in this Font.
public int substringWidth(String str, int offset, int len)Gets the total advance width for showing the specified substring in this Font.
public static Font getDefaultFont() Gets the default font of the system.
public static Font getFont(int fontSpecifier)Gets the Font used by the high level user interface for the fontSpecifier passed in.
public static Font getFont(int face, int style, int size)Obtains an object representing a font having the specified face, style, and size.

javax.microedition.lcdui.Form class

ConstructorDescription
public Form(String title)Creates a new, empty Form.
public Form(String title, Item[] items)Creates a new Form with the specified contents.
MethodDescription
public int append(String str)Adds an item consisting of one String to the Form.
public int append(Image img)Adds an Image into the Form.
public int append(Item item)Adds an Item into the Form.
public int getHeight()Returns the height in pixels of the displayable area available for items.
public int getWidth()Returns the width in pixels of the displayable area available for items.
public int size()Gets the number of items in the Form.
public Item get(int itemNum)Gets the item at given position.
public void delete(int itemNum)Deletes the Item referenced by itemNum.
public void deleteAll()Deletes all the items from this Form, leaving it with zero items.
public void insert(int itemNum, Item item)Inserts an item into the Form just prior to the item specified.
public void set(int itemNum, Item item)Sets the item referenced by itemNum to the specified item, replacing the previous item.
public void setItemStateListener(ItemStateListener iListener)Sets the ItemStateListener for the Form, replacing any previous ItemStateListener.

javax.microedition.lcdui.Gauge class

ConstructorDescription
public Gauge(String label, boolean interactive, int maxValue, int initialValue)Creates a new Gauge object with the given label, in interactive or non-interactive mode, with the given maximum and initial values.
MethodDescription
public boolean isInteractive()Tells whether the user is allowed to change the value of the Gauge.
public int getMaxValue() Gets the maximum value of this Gauge object.
public int getValue()Gets the current value of this Gauge object.
public void setMaxValue(int maxValue) Sets the maximum value of this Gauge object.
public void setValue(int value) Sets the current value of this Gauge object.

javax.microedition.lcdui.Graphics class

ConstructorDescription
Graphics() Constructor for subclasses.
MethodDescription
public int getBlueComponent() Gets the blue component of the current color.
public int getClipHeight()Gets the height of the current clipping area.
public int getClipWidth()Gets the width of the current clipping area.
public int getClipX()Gets the X offset of the current clipping area, relative to the coordinate system origin of this graphics context.
public int getClipY()Gets the Y offset of the current clipping area, relative to the coordinate system origin of this graphics context.
public int getColor()Gets the current color.
public int getDisplayColor(int color)Gets the color that will be displayed if the specified color is requested.
public int getGrayScale()Gets the current grayscale value of the color being used for rendering operations.
public int getGreenComponent()Gets the green component of the current color.
public int getRedComponent()Gets the red component of the current color.
public int getStrokeStyle()Gets the stroke style used for drawing operations.
public int getTranslateX()Gets the X coordinate of the translated origin of this graphics context.
public int getTranslateY()Gets the Y coordinate of the translated origin of this graphics context.
public Font getFont()Gets the current font.
public void clipRect(int x, int y, int width, int height)Intersects the current clip with the specified rectangle.
public void copyArea(int x_src, int y_src, int width, int height, int x_dest, int y_dest, int anchor)Copies the contents of a rectangular area (x_src, y_src, width, height) to a destination area, whose anchor point identified by anchor is located at (x_dest, y_dest).
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)Draws the outline of a circular or elliptical arc covering the specified rectangle, using the current color and stroke style.
public void drawChar(char character, int x, int y, int anchor)Draws the specified character using the current font and color.
public void drawChars(char[] data, int offset, int length, int x, int y, int anchor)Draws the specified characters using the current font and color.
public void drawImage(Image img, int x, int y, int anchor)Draws the specified image by using the anchor point.
public void drawLine(int x1, int y1, int x2, int y2)Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color and stroke style.
public void drawRGB(int[] rgbData, int offset, int scanlength, int x, int y, int width, int height, boolean processAlpha)Renders a series of device-independent RGB+transparency values in a specified region
public void drawRect(int x, int y, int width, int height)Draws the outline of the specified rectangle using the current color and stroke style.
public void drawRegion(Image src, int x_src, int y_src, int width, int height, int transform, int x_dest, int y_dest, int anchor)Copies a region of the specified source image to a location within the destination, possibly transforming (rotating and reflecting) the image data using the chosen transform function
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)Draws the outline of the specified rounded corner rectangle using the current color and stroke style.
public void drawString(String str, int x, int y, int anchor)Draws the specified String using the current font and color.
public void drawSubstring(String str, int offset, int len, int x, int y, int anchor)Draws the specified String using the current font and color.
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)Fills a circular or elliptical arc covering the specified rectangle.
public void fillRect(int x, int y, int width, int height)Fills the specified rectangle with the current color.
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)Fills the specified rounded corner rectangle with the current color.
public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3)Fills the specified triangle will the current color.
public void setClip(int x, int y, int width, int height)Sets the current clip to the rectangle specified by the given coordinates.
public void setColor(int RGB)Sets the current color to the specified RGB values.
public void setColor(int red, int green, int blue)Sets the current color to the specified RGB values.
public void setFont(Font font)Sets the font for all subsequent text rendering operations.
public void setGrayScale(int value)Sets the current grayscale to be used for all subsequent rendering operations.
public void setStrokeStyle(int style)Sets the stroke style used for drawing lines, arcs, rectangles, and rounded rectangles.
public void translate(int x, int y)Translates the origin of the graphics context to the point (x, y) in the current coordinate system.

javax.microedition.lcdui.Image class

ConstructorDescription
Image()Constructor for subclasses.
MethodDescription
public boolean isMutable()Check if this image is mutable.
public int getHeight()Gets the height of the image in pixels.
public int getWidth()Gets the width of the image in pixels.
public Graphics getGraphics()Creates a new Graphics object that renders to this image.
public static Image createImage(byte[] imageData, int imageOffset, int imageLength)Creates an immutable image which is decoded from the data stored in the specified byte array at the specified offset and length.
public static Image createImage(int width, int height)Creates a new, mutable image for off-screen drawing.
public static Image createImage(InputStream stream)Creates an immutable image from decoded image data obtained from an InputStream.
public static Image createImage(String name)Creates an immutable image from decoded image data obtained from the named resource.
public static Image createImage(Image source)Creates an immutable image from a source image.
public static Image createImage(Image image, int x, int y, int width, int height, int transform)Creates an immutable image using pixel data from the specified region of a source image, transformed as specified.
public static Image createRGBImage(int[] rgb, int width, int height, boolean processAlpha)Creates an immutable image from a sequence of ARGB values, specified as 0xAARRGGBB.
public void getRGB(int[] rgbData, int offset, int scanlength, int x, int y, int width, int height)Obtains ARGB pixel data from the specified region of this image and stores it in the provided array of integers.

javax.microedition.lcdui.ImageItem class

ConstructorDescription
public ImageItem(String label, Image img, int layout, String altText)Creates a new ImageItem with the given label, image, layout directive, and alternate text string.
public ImageItem(String label, Image image, int layout, String altText, int appearanceMode) Creates a new ImageItem object with the given label, image, layout directive, alternate text string, and appearance mode.
MethodDescription
public int getAppearanceMode() Returns the appearance mode of the ImageItem.
public int getLayout()Gets the layout directives used for placing the image.
public String getAltText()Gets the text string to be used if the image exceeds the device's capacity to display it.
public Image getImage()Gets the image contained within the ImageItem, or null if there is no contained image.
public void setAltText(String text)Sets the alternate text of the ImageItem, or null if no alternate text is provided.
public void setImage(Image img)Sets the Image object contained within the ImageItem.
public void setLayout(int layout)Sets the layout directives

javax.microedition.lcdui.Item class

ConstructorDescription
Item()Constructor for subclasses.
MethodDescription
public int getLayout()Gets the layout directives used for placing the item.
public int getMinimumHeight()Gets the minimum height for this Item.
public int getMinimumWidth()Gets the minimum width for this Item.
public int getPreferredHeight()Gets the preferred height of this Item.
public int getPreferredWidth()Gets the preferred width of this Item
public String getLabel()Gets the label of this Item object.
public void addCommand(Command cmd)Adds a context sensitive Command to the item.
public void notifyStateChanged()Causes this Item's containing Form to notify the Item's ItemStateListener.
public void removeCommand(Command cmd)Removes the context sensitive command from item.
public void setDefaultCommand(Command cmd)Sets default Command for this Item.
public void setItemCommandListener(ItemCommandListener l)Sets a listener for Commands to this Item, replacing any previous ItemCommandListener.
public void setLabel(String label)Sets the label of the Item.
public void setLayout(int layout)Sets the layout directives for this item.
public void setPreferredSize(int width, int height)Sets the preferred width and height for this Item.

javax.microedition.lcdui.List class

ConstructorDescription
public List(String title, int listType)Creates a new, empty List, specifying its title and the type of the list.
public List(String title, int listType, String[] stringElements, Image[] imageElements)Creates a new List, specifying its title, the type of the List, and an array of Strings and Images to be used as its initial contents.
MethodDescription
public boolean isSelected(int elementNum)Gets a boolean value indicating whether this element is selected.
public int append(String stringPart, Image imagePart)Appends an element to the List.
public int getFitPolicy()Gets the application's preferred policy for fitting Choice element contents to the available screen space.
public int getSelectedFlags(boolean[] selectedArray_return)Queries the state of a List and returns the state of all elements in the boolean array selectedArray_return
public int getSelectedIndex()Returns the index number of an element in the List that is selected.
public int size()Gets the number of elements in the List.
public String getString(int elementNum)Gets the String part of the element referenced by elementNum.
public Font getFont(int elementNum)Sets the application's preferred font for rendering the specified element of this Choice
public Image getImage(int elementNum)Gets the Image part of the element referenced by elementNum.
public void delete(int elementNum)Deletes the element referenced by elementNum.
public void deleteAll()Deletes all elements from this List.
public void insert(int elementNum, String stringPart, Image imagePart)Inserts an element into the List just prior to the element specified.
public void removeCommand(Command cmd)Removes a command from the Displayable but with the following additional semantics.
public void set(int elementNum, String stringPart, Image imagePart)Sets the String and Image parts of the element referenced by elementNum, replacing the previous contents of the element.
public void setFitPolicy(int fitPolicy) Sets the application's preferred policy for fitting Choice element contents to the available screen space.
public void setFont(int elementNum, Font font)Sets the application's preferred font for rendering the specified element of this Choice.
public void setSelectCommand(Command command)Sets the Command to be used for an IMPLICIT List selection action.
public void setSelectedFlags(boolean[] selectedArray)Sets the selected state of all elements of the List.
public void setSelectedIndex(int elementNum, boolean selected)Sets the selected state of an element.

javax.microedition.lcdui.Screen class

ConstructorDescription
Screen()Constructor for subclasses.

javax.microedition.lcdui.Spacer class

ConstructorDescription
public Spacer(int minWidth, int minHeight)Creates a new Spacer with the given minimum size.
MethodDescription
public void addCommand(Command cmd)Spacers are restricted from having Commands, so this method will always throw IllegalStateException whenever it is called.
public void setDefaultCommand(Command cmd)Spacers are restricted from having Commands, so this method will always throw IllegalStateException whenever it is called
public void setLabel(String label)Spacers are restricted to having null labels, so this method will always throw IllegalStateException whenever it is called
public void setMinimumSize(int minWidth, int minHeight)Sets the minimum size for this spacer.

javax.microedition.lcdui.StringItem class

ConstructorDescription
public StringItem(String label, String text) Creates a new StringItem object.
public StringItem(String label, String text, int appearanceMode)Creates a new StringItem object with the given label, textual content, and appearance mode.
MethodDescription
public int getAppearanceMode()Returns the appearance mode of the StringItem
public String getText()Gets the text contents of the StringItem, or null if the StringItem is empty.
public Font getFont()Gets the application's preferred font for rendering this StringItem.
public void setFont(Font font)Sets the application's preferred font for rendering this StringItem.
public void setText(String text)Sets the text contents of the StringItem.

javax.microedition.lcdui.TextBox class

ConstructorDescription
public TextBox(String title, String text, int maxSize, int constraints)Creates a new TextBox object with the given title string, initial contents, maximum size in characters, and constraints.
MethodDescription
public int getCaretPosition()Gets the current input position.
public int getChars(char[] data)Copies the contents of the TextBox into a character array starting at index zero.
public int getConstraints()Gets the current input constraints of the TextBox.
public int getMaxSize()Returns the maximum size (number of characters) that can be stored in this TextBox.
public int setMaxSize(int maxSize)Sets the maximum size (number of characters) that can be contained in this TextBox.
public int size()Gets the number of characters that are currently stored in this TextBox.
public String getString()Gets the contents of the TextBox as a string value.
public void delete(int offset, int length)Deletes characters from the TextBox.
public void insert(char[] data, int offset, int length, int position)Inserts a subrange of an array of characters into the contents of the TextBox.
public void insert(String src, int position)Inserts a string into the contents of the TextBox.
public void setChars(char[] data, int offset, int length)Sets the contents of the TextBox from a character array, replacing the previous contents.
public void setConstraints(int constraints)Sets the input constraints of the TextBox.
public void setInitialInputMode(String characterSubset)Sets a hint to the implementation as to the input mode that should be used when the user initiates editing of this TextBox
public void setString(String text)Sets the contents of the TextBox as a string value, replacing the previous contents.

javax.microedition.lcdui.TextField class

ConstructorDescription
public TextField(String label, String text, int maxSize, int constraints)Creates a new TextField object with the given label, initial contents, maximum size in characters, and constraints.
MethodDescription
public int getCaretPosition()Gets the current input position.
public int getChars(char[] data)Copies the contents of the TextField into a character array starting at index zero.
public int getConstraints()Gets the current input constraints of the TextField.
public int getMaxSize()Returns the maximum size (number of characters) that can be stored in this TextField.
public int setMaxSize(int maxSize)Sets the maximum size (number of characters) that can be contained in this TextField.
public int size()Gets the number of characters that are currently stored in this TextField.
public String getString()Gets the contents of the TextField as a string value.
public void delete(int offset, int length)Deletes characters from the TextField.
public void insert(char[] data, int offset, int length, int position)Inserts a subrange of an array of characters into the contents of the TextField.
public void insert(String src, int position)Inserts a string into the contents of the TextField.
public void setChars(char[] data, int offset, int length)Sets the contents of the TextField from a character array, replacing the previous contents
public void setConstraints(int constraints)Sets the input constraints of the TextField.
public void setInitialInputMode(String characterSubset)Sets a hint to the implementation as to the input mode that should be used when the user initiates editing of this TextField
public void setString(String text)Sets the contents of the TextField as a string value, replacing the previous contents.

javax.microedition.lcdui.Ticker class

ConstructorDescription
public Ticker(String str)Constructs a new Ticker object, given its initial contents string.
MethodDescription
public String getString()Gets the string currently being scrolled by the ticker.
public void setString(String str) Sets the string to be displayed by this ticker.

javax.microedition.lcdui.Choice interface

MethodDescription
public boolean isSelected(int elementNum)Gets a boolean value indicating whether this element is selected.
public int append(String stringPart, Image imagePart)Appends an element to the Choice.
public int getFitPolicy()Gets the application's preferred policy for fitting Choice element contents to the available screen space.
public int getSelectedFlags(boolean[] selectedArray_return)Queries the state of a Choice and returns the state of all elements in the boolean array selectedArray_return
public int getSelectedIndex()Returns the index number of an element in the Choice that is selected.
public int size()Gets the number of elements present.
public String getString(int elementNum)Gets the String part of the element referenced by elementNum.
public Font getFont(int elementNum)Gets the application's preferred font for rendering the specified element of this Choice
public Image getImage(int elementNum)Gets the Image part of the element referenced by elementNum.
public void delete(int elementNum)Deletes the element referenced by elementNum
public void deleteAll()Deletes all elements from this Choice, leaving it with zero elements.
public void insert(int elementNum, String stringPart, Image imagePart)Inserts an element into the Choice just prior to the element specified.
public void set(int elementNum, String stringPart, Image imagePart)Sets the String and Image parts of the element referenced by elementNum, replacing the previous contents of the element.
public void setFitPolicy(int fitPolicy)Sets the application's preferred policy for fitting Choice element contents to the available screen space.
public void setFont(int elementNum, Font font)Sets the application's preferred font for rendering the specified element of this Choice
public void setSelectedFlags(boolean[] selectedArray)Attempts to set the selected state of every element in the Choice.
public void setSelectedIndex(int elementNum, boolean selected)For MULTIPLE, this simply sets an individual element's selected state

javax.microedition.lcdui.CommandListener interface

MethodDescription
public void commandAction(Command c, Displayable d)Indicates that a command event has occurred on Displayable d.

javax.microedition.lcdui.ItemCommandListener interface

MethodDescription
public void commandAction(Command c, Item item)Called by the system to indicate that a command has been invoked on a particular item.

javax.microedition.lcdui.ItemStateListener interface

MethodDescription
public void itemStateChanged(Item item)Called when internal state of an Item has been changed by the user.

Previous Home Next