Sample1
example, the first stage in
this tutorial, you see a scrolling window displaying the picture of
a person.Sample1.java
file follow. Sample1.java
file first
imports the main Rogue Wave® JViews
package and then imports the Rogue Wave JViews Swing package for the GUI components. import ilog.views.*; import ilog.views.swing.*;
swing
and awt
packages: import javax.swing.*; import java.awt.*;
Sample1
. This class has two fields, manager
(class IlvManager) to store the graphic objects, and mgrview
, (class IlvManagerView), to display the contents of the manager. public class Sample1 extends JFrame { IlvManager manager; IlvManagerView mgrview; .... }
... manager = new IlvManager(); ... }
lou.ivl
file which can be found in the data
directory. Rogue Wave JViews Framework provides facilities to save and read
graphic objects in a manager. These files are in the IVL format. IOException
for basic IO errors. IlvReadFileException
, if the format of the file is not correct (the file is not an .ivl
formatted file) or if a graphic class needed to
load the file cannot be found. try { manager.read("data/lou.ivl"); } catch (Exception e) {}
manager
parameter
as shown below. IlvManagerView
and provides scroll bars. mgrview = new IlvManagerView(manager); getContentPane().setLayout(new BorderLayout(0,0)); getContentPane().add(new IlvJScrollManagerView(mgrview), BorderLayout.CENTER);
jviews-framework-all.jar
file in your classpath. On a Windows® machine this will
be: set CLASSPATH=.;<installdir>/jviews-framework89/lib/jviews-framework- all.jar