XML, CSS and swiXML
Satish Kumar <[email protected]>
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
hi
I am trying to use Cascaded Style Sheet in XML file and run that using
swiXML engine[ .java file].
I am unable to get the effect of CSS.
Please help.
// File Name -- IP.css
button
{
background-color: red;
color: green
}
// File name -- IP.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="IP.css" ?>
<frame name="frame" size="450,220" title="License Manager"
layout="BorderLayout" >
<panel name="pn2" Border="EtchedBorder"
constraints="BorderLayout.CENTER"
>
<vbox>
<buttongroup>
<radiobutton id="rbenList" Action="actenList" >enList
</radiobutton>
<radiobutton id="rbenQuare"
Action="actenQuare">enQuire </radiobutton>
</buttongroup>
</vbox>
</panel>
</frame>
//File Name --IPS.java
import org.swixml.SwingEngine;
import javax.swing.*;
import java.awt.event.ActionEvent;
public class IPS
{
int optChoice;
final int ienList=1,ienQuare=2;
private InstalledProducts() throws Exception
{
new SwingEngine( this ).render( "IP.xml" ).setVisible( true );
};
public AbstractAction actenList = new AbstractAction()
{
public void actionPerformed( ActionEvent e )
{
optChoice=ienList;
}
};
public AbstractAction actenQuare = new AbstractAction()
{
public void actionPerformed( ActionEvent e )
{
optChoice=ienQuare;
}
};
public static void main( String[] args ) throws Exception
{
try
{
IPS IP=new InstalledProducts();
}
catch(Exception e)
{
System.out.println("Exception Occured::");
}
};
};