Page 1 of 1

--User defined Components

PostPosted: Fri Sep 17, 2010 10:20 am
by Development@SIB

This article is outdated - please use our new system at

The JVx Enterprise Application Framework offers the convenience of platform independent user interfaces. Since, however, it is not necessary for certain tasks it is also possible to use a specific technology, such as classic Java Swing.

Since JVx already offers swing implementation of the user interfaces, you can not only directly integrate JVx´s swing components in your applications. You can also integrate any swing component in JVx, or simply use it, without adaptation and implementation efforts.

Integration is not limited to the swing components. For example, SWT is also possible, as long as a JVx implementation is available.

The following example shows the integration of standard swing components in theJVx Enterprise Application Framework.


We want to include a chart from JFreeChart in an existing JVx application, such as the Showcase.
The following is the integrated component:

chart.png (118.81 KiB) Viewed 2487 times

Source Code for this example:

Code: Select all
//create the chart
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Germany", 29);
dataset.setValue("Spain", 20);
dataset.setValue("Austria", 51);

JFreeChart chart = ChartFactory.createPieChart3D("JVx integration",

PiePlot3D plot = (PiePlot3D) chart.getPlot();

ChartPanel chartPanel = new ChartPanel(chart);      

panDetails.add(gpanDedails, layout.getConstraints(0, 0, -1, 0));

//ADD the chart as custom component
panDetails.add(new UICustomComponent(chartPanel), layout.getConstraints(0, 1, -1, -1));

Using a single line of code

Code: Select all
panDetails.add(new UICustomComponent(chartPanel), layout.getConstraints(0, 1, -1, -1));

any swing component can be integrated in JVx, with full access to the JVx and swing components.

With the integration of technology dependent components, as shown in our example, the use of other technologies is very limited or not possible (using swing components with SWT is difficult).

However, JVx allows for the implementation of technology independent special components , which can then be integrated in the application. The respective technology will then always use compatible components.