Developing swing GUI using XML

hi
I must develop a GUI using swing by parsing XML documents.How to render the swing objects at run time, after parsing the XML document.I must know the process of creating the swing containers,components from XML document. Some open sources are available for the purpose but i must create a framework for our own purpose, so must know the process involved.
kindly provide me any links or tutorial for the same.
with Regards,
A.Rajesh

hey thanks for the help...i saw these tools but my problem will not be solved by these as the diagram i need to generate from XML is a class diagram. The components of class diagram cannot be made using swings...eg arrow,rectangle,aggregation symbol etc....

Similar Messages

  • Build GUI using XML

    Hi,
    I am interested in learning more about building a UI using XML...any suggestions? I have looked at SwiXml ....just looking for more. If you have used one/or more of them before, let me know what your opinions are to.
    Thanks!

    I know there are several of these things out there. The one I've tried was Thinlets. It looks good and is very lightweight. It's easy to get something running quickly, but you'll eventually run into limitations since the components are by far not as rich and flexible as swing. I still think it's great for what it does.
    If you're going to do a google search, I think one of the key words to use is XUL.

  • GUI in XML

    I am interested in writing some Swing GUI's in XML, and i know there are a couple of programs/libraries that do this (such as UIML), but can you please recommend me some good one? Anybody has any experience with this?
    Thanks in advance,
    Victor.

    There's a few levels of this question I'm sure. You could write Swing GUIs in XML using the XMLEncoder/XMLDecoder framework to effectively write Swing code.
    Then again, you could write XUL, which wouldn't be tied to Swing, but you could use a Swing implementation of it.

  • Error in Dashboard using XML connection

    Hi Experts,
    I have developed one Dashboard using XML connection  but getting bellow attached error can any one guide me how to solve it.
    I know that error is related to cross domain.xml please explain the what is cross domain.xml and guide me to solve issue.
    Regards
    Mahantesh(Monty)

    Hello,
    Please check if below notes are relevant:
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361…
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361…
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361…
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361…

  • XML = Swing GUI, which framework would you recommend?

    Hi,
    I'm looking for a framework that translates an XML description to a Swing GUI.
    There're a lot available, e.g. gui4J, swixml, Thinlet, XUL, XULUX, Jelly, SwingML
    Can you recommend one?
    Are there any drawbacks I should be aware of from using such a framework? How about performance?
    Many thanks

    Hello,
    The SwingAppKit is provided with the source :
    http://www.swingappkit.com
    It focuses on dialogs, preferences, XML application descriptor.
    Best wishes,
    A.Brillant

  • How to display multiple tables from database using netbeans swing gui

    plz reply asap on how to display multiple tables from database using netbeans swing gui into the same project

    Layered Pane with JTables or you can easily to it with a little scripting and HTML.
    plzzzzzzzzzzzzzzzzz, do not use SMS speak when posting.

  • Develop UI displaying Tree Using XML

    Hi Techies,
    I am in the process of developing a UI that should show a tree (not like folder structure).
    The tree should start from root node and that may contain n-children and similarly n-levels.
    Currently I have a XML file that has the information about the Parent Children relationships.
    I wanted to know how to parse this XML and put in the form of UI, the bottom line is, "Developing UI by using XMLfile in Java Code".
    I hope I am clear.
    Waiting for the reply(ies).
    Thanks
    - Vikas DK

    have two tier architecture... One is View and another one is model&controller
    For view use JTree to construct root and show thier children in the form of nodes.
    In the model part,use DOM parser to read the XML and store it as a document. From the document read the elements and populate the tree nodes in the view part....
    This is a highlevel approach.. ... do u expect any specific implementation details

  • Loading large files in Java Swing GUI

    Hello Everyone!
    I am trying to load large files(more then 70 MB of xml text) in a Java Swing GUI. I tried several approaches,
    1)Byte based loading whith a loop similar to
    pane.setText("");
                 InputStream file_reader = new BufferedInputStream(new FileInputStream
                           (file));
                 int BUFFER_SIZE = 4096;
                 byte[] buffer = new byte[BUFFER_SIZE];
                 int bytesRead;
                 String line;
                 while ((bytesRead = file_reader.read(buffer, 0, BUFFER_SIZE)) != -1)
                      line = new String(buffer, 0, bytesRead);
                      pane.append(line);
                 }But this is gives me unacceptable response times for large files and runs out of Java Heap memory.
    2) I read in several places that I could load only small chunks of the file at a time and when the user scrolls upwards or downwards the next/previous chunk is loaded , to achieve this I am guessing extensive manipulation for the ScrollBar in the JScrollPane will be needed or adding an external JScrollBar perhaps? Can anyone provide sample code for that approach? (Putting in mind that I am writting code for an editor so I will be needing to interact via clicks and mouse wheel roatation and keyboard buttons and so on...)
    If anyone can help me, post sample code or point me to useful links that deal with this issue or with writting code for editors in general I would be very grateful.
    Thank you in advance.

    Hi,
    I'm replying to your question from another thread.
    To handle large files I used the new IO libary. I'm trying to remember off the top of my head but the classes involved were the RandomAccessFile, FileChannel and MappedByteBuffer. The MappedByteBuffer was the best way for me to read and write to the file.
    When opening the file I had to scan through the contents of the file using a swing worker thread and progress monitor. Whilst doing this I indexed the file into managable chunks. I also created a cache to further optimise file access.
    In all it worked really well and I was suprised by the performance of the new IO libraries. I remember loading 1GB files and whilst having to wait a few seconds to perform the indexing you wouldn't know that the data for the JList was being retrieved from a file whilst the application was running.
    Good Luck,
    Martin.

  • Gui xalan xml

    I am trying to program a java swing gui with one button that will
    transform old.xml to new.xml using transform.xsl using xalan
    but the compiler gives an error message:
    Transform2.java:53: unreported exception javax.xml.transform.TransformerException; must be caught or declared to be thrown
    transformation("hamlet.xml","transformation1.xsl","hamletnew.xml"
    anyone know the solution of this problem
    this is the complete code:
    //using apache xalan to transform old.xml with tranform.xsl into new.xml
    //with java swing gui
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    public class Transform2
    public static void main(String[] args)throws TransformerException, TransformerConfigurationException,FileNotFoundException, IOException
    JFrame frame = new JFrame("Event Handling Tombol & TextField");
    final JButton button = new JButton("Transform");
    ActionListener eventclick =
    new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() == button) {
    transformation("old.xml","transform.xsl","new.xml");
    button.addActionListener(eventclick);
    frame.getContentPane().setLayout(new FlowLayout());
    frame.getContentPane().add(button);
    frame.pack();
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    private static void transformation(String inputfile,String xslfile,String outputfile)throws TransformerException, TransformerConfigurationException,FileNotFoundException, IOException
    // Use the static TransformerFactory.newInstance() method to instantiate
    // a TransformerFactory. The javax.xml.transform.TransformerFactory
    // system property setting determines the actual class to instantiate --
    // org.apache.xalan.transformer.TransformerImpl.
    TransformerFactory tFactory = TransformerFactory.newInstance();
    // Use the TransformerFactory to instantiate a Transformer that will work with
    // the stylesheet you specify. This method call also processes the stylesheet
    // into a compiled Templates object.
    Transformer transformer = tFactory.newTransformer(new StreamSource(xslfile));
    // Use the Transformer to apply the associated Templates object to an XML document
    // (foo.xml) and write the output to a file (foo.out).
    transformer.transform(new StreamSource(inputfile), new StreamResult(new FileOutputStream(outputfile)));

    Function
    private static void transformation(String inputfile,String xslfile,String outputfile)throws TransformerException, TransformerConfigurationException,FileNotFoundException, IOExceptionStates that that function might throw an on of the exceptions mentioned.. to do this you have to have
    try{
       //the code that this function should do...
    catch(Exception e)
        // if doing previous stuff fails... this will be executed.
        // here do the throwing..
        throw new IOException (this);
    }also the main function propably should not throw exceptions..
    P_s

  • Recommended Tool for devloping Swing GUI's?

    Hello everyone.
    I was wondering what a good tool kit was for building swing gui's?
    I heard NetBean was one, any others you recommend?
    Currently I use Rational Software Architect to do all my java coding but I don't see any options in this IDE for creating drag and drop GUI development.
    Thanks!

    You have 2 very different answers to consider. Before making your final decision, I'd ask yourself, which of the two responders is a Swing expert and which isn't. That should put a whole lot of added weight to one of the recs. Just my two scheckel's worth.

  • Embedding applets in Swing GUI?

    I'm pretty new to developing with Swing.
    I want to know what I would need to do in order to embed an applet inside a Swing GUI (if this is possible). I've looked around, but can't seem to find anything with an answer to my question.
    Any help would be greatly appreciated.

    import javax.swing.*;
    import java.applet.Applet;
    import java.awt.Label;
    /** Simplistic example of putting an Applet in a JFrame. */
    public class AppletInSwingGui extends Applet {
      public void init() {
        add( new Label("I am an applet!") );
      public static void main(String[] args) {
        final AppletInSwingGui applet = new AppletInSwingGui();
        // very important!
        applet.init();
        Runnable r = new Runnable() {
          public void run() {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add( applet );
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        SwingUtilities.invokeLater(r);
    }Note that if the applet uses the functionality of the AppletContext, the programmer needs to implement it. Some of the Applet specific methods (like getDocumentBase() and getCodeBase()) are also a bit tricky.
    Edited by: AndrewThompson64 on May 20, 2008 12:37 PM

  • Develop Java GUI to interact with MS Access

    I am doing a Java course and got this assignment to develop a GUI application using MS Access to get data and to update information for an automated library system. I would realy like some help with integrating the GUI with Access. I started Java a few weeks ago from scratch and would appreciate all the help I could get. I really have fallen in love with Java and I think that it is a really great programming language to use. I really would love to become a Java expert some day.

    Take a look at the Java tutorials page. Theres a tutorial on "Creating a GUI Using JFC/Swing" and "JDBC Database Access":
    http://java.sun.com/docs/books/tutorial/

  • Launch swing GUI on MAC

    I developed a swing GUI recently. It works perfectly under Linux, Unix, Windows, but the users of the GUI will run it on MAC. I haven't any idea about MAC. Does anybody give me some suggestions about
    How to launch my application on mac?
    Are there any strategies or tricks for running a swing GUI on MAC?
    How can I put a shortcut or icon on user's desktop of mac so that when the user click it, my swing gui can open immediately?
    Thank a million in advance

    Well... on Mac OS X, it is very easy. You just put your application in a .jar file. On Mac OS X, jar files are automatically run when double clicked. You won't have to worry about downloading a jdk, because it is integrated with the system.
    Mac OS 9 however only made it to jdk version 1.1.8, and you will have to use the Bindary program to make it runnable. Strongly suggest users to upgrade to Mac OS X, because on 9, it is a pain...
    With pleasure,
    Wannes.

  • How to Generate graphical Layout using XML

    Hi,
    I am developing a small application in java swing component. I want to use xml for layout generation. I have defined some attribute like textbox, label, textarea, image. but when the code is reading from java class. it is giving me some text only on the basis of their attribute. but I want to browse the xml which automatically generates the graphical layout. please let me know if there is any help related to this post.
    I am looking for help to do this. If there is any api to do this please let me know.
    Thanks in advance
    Manveer Singh

    Moderator advice: Don't double post the same question. Your other thread in Java 2D has been removed.
    Moderator action: Moved from General XML
    db

  • Multi-Client TCP Server /w Swing GUI

    Hi everybody,
    i have to develop a Multi-Client TCP Server with a Swing GUI. The GUI mainly consists of a JTable which shows various trace messages from processes running on other computers. As the data needs to be filtered i�m using a custom TableModel derived from AbstractTableModel. I�m creating a new thread for every client that connects as shown in http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html
    Now every client thread reads data from its TCP connection and puts it into the JTable by calling the method addRow of the model. But i�m getting strange NullPointerExceptions and IndexOutOfBoundExceptions when data arrives (i�m using ArrayList in the model). These exceptions never show in a single-threaded Swing app (i�ve tested this already, so i don�t think it�s a bug in my model), so i think this is a problem with Swing�s thread unsafety? Do you have any hints on how to get away with it? Also general design tips for a Multi-Client TCP Server /w Swing GUI are greatly appreciated.
    Thanks in advance!
    Best regards,
    Disposable_Hero

    Of course, but i don�t think it is the model (as said before it works fine in a single thread swing app)
    Here�s the code:
    public class LogTableModel extends AbstractTableModel{
    private Vector dataVector;
    private Vector filterVector;
    private String[] columnIdentifiers;
    private Vector filteredbyProcess;
    private Vector filteredbyLoglevel;
    private boolean bEnableRefresh;
    /** Creates a new instance of LogTableModel */
    public LogTableModel() {
    dataVector=new Vector(0);
    columnIdentifiers=new String[]{"LogTime","HostName","IP","ProcessName","LogLevel","Handle","PID","TID","LogData"};
    filteredbyProcess=new Vector(0);
    filteredbyLoglevel=new Vector(0);
    filterVector=new Vector(0);
    bEnableRefresh=true;
    public synchronized void enableRefresh(boolean bEnableRefresh){
    this.bEnableRefresh=bEnableRefresh;
    if(bEnableRefresh){
    this.buildIndexListBasedOnFilter();
    public synchronized void addRow(LogLine row){
    dataVector.add(row);
    if(bEnableRefresh)
    this.buildIndexListBasedOnFilter();
    public synchronized void addFilter(Filter filter){
    filterVector.add(filter);
    if(filter.isActive())
    this.buildIndexListBasedOnFilter();
    public synchronized void setFilterActive(String name,boolean active){
    int i;
    for(i=0;i<filterVector.size();i++)
    if(((Filter)filterVector.elementAt(i)).getName().equals(name))
    break;
    Filter tmp=(Filter)filterVector.elementAt(i);
    tmp.setActive(active);
    if(active)
    this.buildIndexListBasedOnFilter();
    public synchronized void setFilterLoglevel(String name,int Loglevel){
    int i;
    for(i=0;i<filterVector.size();i++)
    if(((Filter)filterVector.elementAt(i)).getName().equals(name))
    break;
    Filter tmp=(Filter)filterVector.elementAt(i);
    tmp.setLoglevel(Loglevel);
    if(tmp.isActive()==false)
    this.buildIndexListBasedOnFilter();
    private void buildIndexListBasedOnFilter(){
    filteredbyProcess.clear();
    filteredbyLoglevel.clear();
    applyProcessFilter();
    applyLoglevelFilter();
    if(bEnableRefresh)
    this.fireTableDataChanged();
    private void applyProcessFilter(){
    LogLine line=null;
    Filter filter=null;
    for(int i=0;i<dataVector.size();i++){
    for(int j=0;j<filterVector.size();j++){
    filter=(Filter)filterVector.elementAt(j);
    line=(LogLine)dataVector.elementAt(i);
    if(filter.isActive()&&(filter.getName().equals(line.getProcessName()))){
    line.setHidden(true);
    break;
    else{
    line.setHidden(false);
    if(line.getHidden()!=true)
    filteredbyProcess.add(new Integer(i));
    private void applyLoglevelFilter(){
    for(int i=0;i<filteredbyProcess.size();i++){
    int index=((Integer)filteredbyProcess.get(i)).intValue();
    LogLine line=(LogLine)dataVector.elementAt(index);
    for(int j=0;j<filterVector.size();j++){
    if(((Filter)filterVector.elementAt(j)).getName().equals(line.getProcessName())){
    Filter filter=(Filter)filterVector.elementAt(j);
    if((filter.getLoglevel()&line.getLogLevelAsInt())!=line.getLogLevelAsInt())
    line.setHidden(true);
    else
    filteredbyLoglevel.add(new Integer(index));
    break;
    public synchronized String getColumnName(int columnIndex){
    return columnIdentifiers[columnIndex];
    public synchronized void clearData(){
    dataVector.clear();
    filteredbyProcess.clear();
    filteredbyLoglevel.clear();
    public synchronized int getColumnCount() {
    return columnIdentifiers.length;
    public synchronized int getRowCount() {
    return filteredbyLoglevel.size();
    public synchronized Object getValueAt(int rowIndex, int columnIndex) {
    int iIndex=((Integer)filteredbyLoglevel.get(rowIndex)).intValue();// hier krachts warum???
    LogLine tmp=(LogLine)dataVector.elementAt(iIndex);
    switch(columnIndex){
    case 0:
    return tmp.getLogTime();
    case 1:
    return tmp.getHostName();
    case 2:
    return tmp.getIP();
    case 3:
    return tmp.getProcessName();
    case 4:
    return tmp.getLogLevel();
    case 5:
    return tmp.getHandle();
    case 6:
    return tmp.getProcessID();
    case 7:
    return tmp.getThreadID();
    case 8:
    return tmp.getLogData();
    default:
    return null;

Maybe you are looking for

  • Error message after trying to download the new photoshop update

    I have attempted to download the new update for photoshop cs6 several times .. after downloanding and installing i get an error message U44M1P7 at the end of each attempt .. it appears to be fine until after the download is completed ... i have tried

  • DVD ROMS Ejecting after start up.

    System Configuration: CPU:  2.5 Ghz P4 Motherboard: Motherboard- MSI 865PE Neo2-V  (V Class) Chipset 865PE + ICH5 Chipset base RAM: 500 Mb Video Card: ATI Radeon 9200 SE Operating System: Windows XP home edition Nb. Two DVD drives connected master &

  • Could not resolve host (nil); Unknown error

    Trying to install arch linux into virtualbox... I got it to boot and everything, got my internet set up (I think), installed virtualbox guest stuff, and then had to reboot. I try to do sudo pacman -S xorg-twm xorg-xclock xterm so that I can test X be

  • Implementing a US Customer Driven Health Care Plan and HSA

    We are implementing a US CDHP and HSA and we have employees situated from California to New York.  We are using a third party for Benefits and as such we only have to create Wage Types so that they can pass to our Payroll which is run in house.  I un

  • Mediathek incompletely displayed on iOS devices

    Our mediathek appears incomplete, unsorted, with wrong covers attached to albums when accessed from an iOS device via Home Sharing (iPod touch, iPad). Disabling and re-enabling home sharing on the iOS devices and the PC fixed the issue only temporari