Προς το περιεχόμενο

applet not seeing jar


Linuxmaniac

Προτεινόμενες αναρτήσεις

geia xara,

exo ena appelt to opoio mesa apo netbeans trexei.kalei methodous kapoion jar arxeion oxi dikon mou.to netbeans profanos ta vlepei auta ta jars kai trexei to applet.pou prepei na valo ta jar kai to applet gia na ta dei?

exo to html arxeio pou kalei to applet sto ROOT tou tomcat kai ta jar arxeia einai mesa sto WEB-INF/lib oste na ta vlepoun kapoia servletes pou exo ftiaksei.ta servlets einai sto fakelo WEB-INF/classes kai vlepoun ta jar,douleoun.otan vazo ekei to applet.class den ta vlepei.ti ginetai?na valo kai to html kai to applet.class sto fakelo lib?ligo mpakalistiko

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

oraia ta evala ta jar ekei pou les alla pali tipota.

Apache Software Foundation\Tomcat 5.5\common\lib ekei den ennoouses?

 

oriste kai o kodikas

import com.hp.hpl.jena.ontology.*;

import com.hp.hpl.jena.util.iterator.*;

import com.hp.hpl.jena.rdf.model.*;

import javax.swing.tree.DefaultMutableTreeNode;

import javax.swing.JTree;

import javax.swing.tree.DefaultMutableTreeNode;

import javax.swing.tree.DefaultTreeModel;

import javax.swing.JFrame;

import javax.swing.JScrollPane;

import javax.swing.SwingUtilities;

import javax.swing.event.TreeSelectionListener;

import javax.swing.event.TreeSelectionEvent;

import java.awt.Container;

import java.awt.Graphics;

import java.awt.BorderLayout;

import java.awt.event.WindowAdapter;

import java.awt.event.WindowEvent;

import java.awt.event.MouseEvent;

import java.awt.event.MouseAdapter;

import java.util.List;

import java.util.ArrayList;

import java.util.Map;

import java.util.TreeMap;

import java.util.Iterator;

 

import java.util.*;

import org.mindswap.pellet.jena.PelletReasonerFactory;

import com.hp.hpl.jena.ontology.*;

import com.hp.hpl.jena.rdf.model.*;

import com.hp.hpl.jena.shared.PrefixMapping;

import com.hp.hpl.jena.util.iterator.Filter;

import com.hp.hpl.jena.util.iterator.ExtendedIterator;

import com.hp.hpl.jena.reasoner.ReasonerRegistry;

import com.hp.hpl.jena.reasoner.dig.*;

import com.hp.hpl.jena.query.*;

 

import com.hp.hpl.jena.sparql.util.IndentedWriter;

import com.hp.hpl.jena.query.*;

import com.hp.hpl.jena.rdf.model.*;

import com.hp.hpl.jena.vocabulary.DC;

import com.hp.hpl.jena.query.QueryFactory;

import java.io.*;

import com.hp.hpl.jena.db.*;

import com.hp.hpl.jena.rdf.model.*;

 

 

import com.hp.hpl.jena.ontology.OntModelSpec;

import org.mindswap.pellet.jena.PelletReasoner;

import org.mindswap.pellet.jena.*;

import org.mindswap.pellet.jena.PelletInfGraph;

import java.util.Properties;

import java.util.Iterator;

import java.io.BufferedInputStream;

import java.io.File;

import java.io.FileInputStream;

import java.io.IOException;

import com.hp.hpl.jena.rdf.model.Model;

import com.hp.hpl.jena.rdf.model.InfModel;

import com.hp.hpl.jena.rdf.model.ModelFactory;

import com.hp.hpl.jena.rdf.model.Resource;

import com.hp.hpl.jena.reasoner.ReasonerRegistry;

import com.hp.hpl.jena.reasoner.Reasoner;

 

import java.io.*;

import java.net.*;

import java.awt.event.*;

 

public class myApplet extends javax.swing.JApplet {

 

static JTree myTree;

static String whatPressed = "";

Erotima erotima = new Erotima();

OntModel model= erotima.loadMyModel();

 

public void init()

{

Iterator itRootCls = model.listHierarchyRootClasses().filterDrop( new Filter() {

public boolean accept( Object o ) {

return ((Resource) o).isAnon();

}

}

);

List rootNodes = createTreeNodes(itRootCls);

 

//The root, superclass of all classes is owl:Thing

DefaultMutableTreeNode root = new DefaultMutableTreeNode("owl:Thing");

//adds all nodes to the root node

Iterator it2 = rootNodes.iterator();

while (it2.hasNext())

root.add((DefaultMutableTreeNode)it2.next());

//build a defaultTreeModel

DefaultTreeModel treeModel = new DefaultTreeModel(root);

//and adds it to the JTree

myTree = new JTree(treeModel);

myTree.addMouseListener(new MouseAdapter() {

public void mouseReleased(MouseEvent e) {

if(SwingUtilities.isLeftMouseButton(e)) {

//erotima.listProps(whatPressed,model);

Iterator i = model.listNameSpaces();

while(i.hasNext()) {

String temp = i.next().toString();

if (temp.contains(".owl")) {

System.out.println("\nnamespace = "+ temp);

}

}

 

}

}

}

);

myTree.addTreeSelectionListener(new TreeSelectionListener() {

public void valueChanged(TreeSelectionEvent evt) {

// Get all nodes whose selection status has changed

System.out.println(evt.getPath().getLastPathComponent());

whatPressed = evt.getPath().getLastPathComponent().toString();

}

});

JFrame frame = new JFrame("Apeikonisi Se Dentro");

frame.addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent e) {

System.exit(0);

}

}

);

 

Container cont = frame.getContentPane();

cont.setLayout(new BorderLayout());

cont.add(BorderLayout.CENTER, myTree);

cont.add(new JScrollPane(myTree), BorderLayout.CENTER);

frame.setBounds(100, 100, 300, 800);

//frame.setVisible(true);

//this.getContentPane().add(frame);

this.add(cont);

 

 

/*

Container cont = frame.getContentPane();

cont.setLayout(new BorderLayout());

cont.add(BorderLayout.CENTER, myTree);

cont.add(new JScrollPane(myTree), BorderLayout.CENTER);

frame.setBounds(100, 100, 300, 800);

frame.setVisible(true);

*/

 

 

// new myApplet().show();

}

public void paint(Graphics g)

{

super.paint(g);

 

}

public static List createTreeNodes(Iterator RootCls) {

//The treemap contains the ontology classes for a given proof

//The treemap allows having a sorted list and thus, a sorted JTree

Map map = new TreeMap();

while (RootCls.hasNext()) {

OntClass o = (OntClass) RootCls.next();

map.put(o.getLocalName(), o);

}

 

//rootList contains all nodes for a given level

//nodes will be added to the JTree

List rootList = new ArrayList();

Iterator a = map.values().iterator();

while (a.hasNext())

rootList.add(new DefaultMutableTreeNode(((OntClass)a.next()).getLocalName()));

 

//for each class, let's list its subclasses

//anonymous classes and 'owl:Nothing' classes are dropped

Iterator it = map.values().iterator();

for (int i = 0; i < map.values().size(); i++) {

OntClass o = (OntClass) it.next();

List sub;

if (o.hasSubClass()) {

sub = createTreeNodes(o.listSubClasses(true).filterDrop(new Filter() {

public boolean accept(Object o) {

return ((Resource)o).isAnon() || ((Resource)o).getLocalName().equals("Nothing");

}

}

));

DefaultMutableTreeNode temp = (DefaultMutableTreeNode)rootList.get(i);

Iterator subit = sub.iterator();

//adds all subnodes

while (subit.hasNext())

temp.add((DefaultMutableTreeNode)subit.next());

}

}

 

return rootList;

}

 

 

 

 

 

 

}

 

 

applet not inited

java.lang.NoClassDefFoundError: com/hp/hpl/jena/util/iterator/Filter

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...