| java.lang.Object thinwire.ui.AbstractComponent thinwire.ui.Image
Image | public class Image extends AbstractComponent implements ImageComponent(Code) | | A component that displays an image. Only PNG, JPEG or GIF are supported.
The format for the image name can be one of the following:
- A file that is pathed relative to the context.
- A file that is fully pathed.
- A file that is loaded as a class resource. Syntax:
class:///[fully-qualified-classname]/[folder-under-class-pacakge]/[image-name]
example: class:///thinwire.ui.layout.SplitLayout/resources/Image.png
Example:
Dialog dlg = new Dialog("Image Test");
dlg.setBounds(25, 25, 300, 140);
for (int i = 0; i < 10; i++) {
Image img = new Image("resources/ngLF/star.png");
img.setBounds(25 + (i * 21), 25, 20, 20);
dlg.getChildren().add(img);
}
for (int i = 0; i < 10; i++) {
Image img = new Image("resources/ngLF/bolt.png");
img.setBounds(25 + (i * 21), 46, 20, 20);
dlg.getChildren().add(img);
}
Button btn = new Button("Ok", "resources/ngLF/ok.png");
btn.setBounds(110, 70, 80, 30);
dlg.getChildren().add(btn);
dlg.setVisible(true);
Keyboard Navigation:
author: Joshua J. Gertzen |
Constructor Summary | |
public | Image() Constructs a new Image with no image fileName. | public | Image(String fileName) Constructs a new Image with the specified fileName as its image. |
Image | public Image()(Code) | | Constructs a new Image with no image fileName.
|
Image | public Image(String fileName)(Code) | | Constructs a new Image with the specified fileName as its image.
Parameters: fileName - a file name that specifies an image to display. |
Methods inherited from thinwire.ui.AbstractComponent | public void addActionListener(String action, ActionListener listener)(Code)(Java Doc) public void addActionListener(String[] actions, ActionListener listener)(Code)(Java Doc) public void addDropListener(Component dragComponent, DropListener listener)(Code)(Java Doc) public void addDropListener(Component[] dragComponents, DropListener listener)(Code)(Java Doc) public void addKeyPressListener(String keyPressCombo, KeyPressListener listener)(Code)(Java Doc) public void addKeyPressListener(String[] keyPressCombos, KeyPressListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String[] propertyNames, PropertyChangeListener listener)(Code)(Java Doc) public void fireAction(ActionEvent ev)(Code)(Java Doc) public void fireAction(String action)(Code)(Java Doc) public void fireAction(String action, Object source)(Code)(Java Doc) public void fireDrop(DropEvent ev)(Code)(Java Doc) public void fireDrop(Component dragComponent)(Code)(Java Doc) public void fireDrop(Component dragComponent, Object dragObject)(Code)(Java Doc) public void fireKeyPress(KeyPressEvent ev)(Code)(Java Doc) public void fireKeyPress(String keyPressCombo)(Code)(Java Doc) final protected boolean firePropertyChange(Object source, String propertyName, int oldValue, int newValue)(Code)(Java Doc) final protected boolean firePropertyChange(Object source, String propertyName, boolean oldValue, boolean newValue)(Code)(Java Doc) final protected boolean firePropertyChange(Object source, String propertyName, Object oldValue, Object newValue)(Code)(Java Doc) public Container getContainer()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Label getLabel()(Code)(Java Doc) public Object getLimit()(Code)(Java Doc) public Object getParent()(Code)(Java Doc) String getStandardPropertyUnsupportedMsg(String propertyName, boolean read)(Code)(Java Doc) public Style getStyle()(Code)(Java Doc) public Object getUserObject()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getX()(Code)(Java Doc) public int getY()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) final public boolean isFocus()(Code)(Java Doc) public boolean isFocusCapable()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) public void removeActionListener(ActionListener listener)(Code)(Java Doc) public void removeDropListener(DropListener listener)(Code)(Java Doc) public void removeKeyPressListener(KeyPressListener listener)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public Component setBounds(int x, int y, int width, int height)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocus(boolean focus)(Code)(Java Doc) public void setFocusCapable(boolean focusCapable)(Code)(Java Doc) public void setHeight(int height)(Code)(Java Doc) void setLabel(Label label)(Code)(Java Doc) public Component setLimit(Object limit)(Code)(Java Doc) void setParent(Object parent)(Code)(Java Doc) public Component setPosition(int x, int y)(Code)(Java Doc) void setRenderer(Renderer r)(Code)(Java Doc) public Component setSize(int width, int height)(Code)(Java Doc) public void setUserObject(Object userObject)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public void setWidth(int width)(Code)(Java Doc) public void setX(int x)(Code)(Java Doc) public void setY(int y)(Code)(Java Doc)
|
|
|