Trace:
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
jvx:client:gui:imagelibrary [2018/02/02 09:01] admin created |
jvx:client:gui:imagelibrary [2024/11/18 10:30] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~Title: Using the Image Library~~ | ~~Title: Using the Image Library~~ | ||
- | The Image Library is used to conveniently access pictures in an application. Pictures are usually stored in the classpath of an application and loaded using the complete resource path. For example: | + | The Image Library is used to conveniently access pictures in an application. Pictures are usually stored in the class path of an application and loaded using the complete resource path. For example: |
<file java> | <file java> | ||
- | Toolkit.class.getResourceAsStream("/javax/rad/genui/images/32x32/about.png"); | + | Toolkit.class.getResourceAsStream("/jvx/rad/genui/images/32x32/about.png"); |
</file> | </file> | ||
Line 11: | Line 11: | ||
<file java> | <file java> | ||
//possible | //possible | ||
- | UIImage.getImage("/javax/rad/genui/images/32x32/about.png"); | + | UIImage.getImage("/jvx/rad/genui/images/32x32/about.png"); |
//recommended | //recommended | ||
Line 32: | Line 32: | ||
== Example == | == Example == | ||
- | Our Application only uses the Image Library for the display of pictures/icons. We use predefined pictures and additionally define our own pictures that are not contained in the Image Library. We also change some of the predefined pictures, since they do not suit our taste. | + | Our Application only uses the Image Library for the display of pictures/icons. We use predefined pictures and additionally define our own pictures that are not contained in the Image Library. We also change some of the predefined pictures as they do not suit our taste. |
We define the changes in our application´s constructor: | We define the changes in our application´s constructor: | ||
Line 52: | Line 52: | ||
</file> | </file> | ||
- | On one of our work-screens we now use the Image Library for our button's pictures: | + | On one of our workscreens, we now use the Image Library for our buttons' pictures: |
<file java> | <file java> | ||
Line 74: | Line 74: | ||
/** Yes/ No Choice editor. */ | /** Yes/ No Choice editor. */ | ||
new UIChoiceCellEditor(new Object [] {"Y", "N"}, | new UIChoiceCellEditor(new Object [] {"Y", "N"}, | ||
- | new String [] {"/javax/rad/genui/images/16x16/check_yes.png", | + | new String [] {"/jvx/rad/genui/images/16x16/check_yes.png", |
- | "/javax/rad/genui/images/16x16/check.png"}, | + | "/jvx/rad/genui/images/16x16/check.png"}, |
- | "/javax/rad/genui/images/16x16/check.png"); | + | "/jvx/rad/genui/images/16x16/check.png"); |
</file> | </file> | ||
Line 91: | Line 91: | ||
**<fs 20px>Note</fs>** | **<fs 20px>Note</fs>** | ||
- | The Image Library saves pictures that have already been used, which prevents loading the same picture multiple times. This not only saves memory, it also positively affects performance. | + | The Image Library saves pictures that have already been used, which prevents loading the same picture multiple times. This not only saves memory, but also positively affects performance. |