This
scenario will test the ability of the Visual Editor to function with icons (ImageIconCellEditor) upon swing components.
Get
the latest build, and create a Java project
Create a Visual Class extending a JFrame with Swing. Drop a jButton,
or any other swing component, on to the content pane.
And go to 'icon' in the properties and select the
property editor button.
![]()
This should launch the following dialog.
![]()
·
Select to ‘Browse in’ the 'File System'.
Go to a ‘Location’ where you wish to get your image from.
A list of images should then appear in the ‘Files’ pane, and all of the images
should have thumbnails previewed in the ‘Available images’ pane.
Select the desired image and press the OK button.
Verify that the image should now appear upon the jButton.
·
Save the visual class and verify that the
source has been updated with code to
include the image upon the swing component?
![]()
·
Import an image file into the java project.
Then drop another swing component on to the content pane.
And from the 'icon' property editor bring up the image file dialog as before.
But this time ‘Browse in’ the 'Project', and select the image previously
imported into the java project. And select OK.
Verify that the image selected from the ‘Project’ appears upon the swing
component.
![]()
·
Drop
the following Swing Containers on to
the canvas and verify that an image can be added via the specific
image property and that visual class will save without
errors. And verify that the source
has been updated with code to include the image upon the swing component:
o
JFrame –
Drop a JFrame on to the canvas and select the iconImage button
from
the properties. This should insert the
image into the title bar of the jframe.
o
JInternalFrame
– Drop a JInternalFrame on to the canvas and select
the frameIcon button
. This should insert the image into the title
bar.
·
Drop
the following AWT Controls on to the canvas and verify that the image can be added via
the properties view. And verify that the source has been updated with code to include the image upon the AWT component:
o
Frame –
select the iconImage property editor
. This should insert the image into the title
bar of the frame.