Click here to Skip to main content
15,911,139 members
Home / Discussions / Java
   

Java

 
AnswerRe: java programmimg Pin
Member 1494135617-Sep-20 19:39
Member 1494135617-Sep-20 19:39 
AnswerRe: java programmimg Pin
Sandeep Mewara17-Sep-20 20:23
mveSandeep Mewara17-Sep-20 20:23 
AnswerRe: java programmimg Pin
Gerry Schmitz18-Sep-20 0:44
mveGerry Schmitz18-Sep-20 0:44 
GeneralRe: java programmimg Pin
Dave Kreskowiak18-Sep-20 4:33
mveDave Kreskowiak18-Sep-20 4:33 
QuestionIntegrating keycloak with spring security Pin
arunken16-Sep-20 21:30
arunken16-Sep-20 21:30 
QuestionHelp me! Pin
Member 1492738231-Aug-20 8:30
Member 1492738231-Aug-20 8:30 
AnswerRe: Help me! Pin
ZurdoDev31-Aug-20 9:37
professionalZurdoDev31-Aug-20 9:37 
AnswerRe: Help me! Pin
ZurdoDev31-Aug-20 9:38
professionalZurdoDev31-Aug-20 9:38 
AnswerRe: Help me! Pin
Afzaal Ahmad Zeeshan31-Aug-20 17:52
professionalAfzaal Ahmad Zeeshan31-Aug-20 17:52 
AnswerRe: Help me! Pin
Richard MacCutchan31-Aug-20 21:11
mveRichard MacCutchan31-Aug-20 21:11 
QuestionHow can I solve the following error: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; Pin
Member 1469623621-Jul-20 18:41
Member 1469623621-Jul-20 18:41 
AnswerRe: How can I solve the following error: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; Pin
Richard MacCutchan21-Jul-20 21:41
mveRichard MacCutchan21-Jul-20 21:41 
AnswerRe: How can I solve the following error: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; Pin
ZurdoDev31-Aug-20 9:37
professionalZurdoDev31-Aug-20 9:37 
QuestionBLOB TO MySQL Pin
Member 1489223717-Jul-20 6:28
Member 1489223717-Jul-20 6:28 
QuestionJava tuition/courses Pin
jopag80003-Jul-20 8:54
jopag80003-Jul-20 8:54 
AnswerRe: Java tuition/courses Pin
Richard MacCutchan10-Jul-20 22:08
mveRichard MacCutchan10-Jul-20 22:08 
QuestionSSLSocket.getInputStream() hangs when called Java 11 Pin
nrmad1-Jul-20 8:35
nrmad1-Jul-20 8:35 
AnswerMessage Closed Pin
16-Feb-22 23:05
Weent1916-Feb-22 23:05 
AnswerMessage Closed Pin
16-Feb-22 23:05
Weent1916-Feb-22 23:05 
QuestionIntegration Pin
GauravSahu911-Jul-20 0:39
GauravSahu911-Jul-20 0:39 
AnswerRe: Integration Pin
OriginalGriff1-Jul-20 0:41
mveOriginalGriff1-Jul-20 0:41 
QuestionHow to dynamically RDF resources in java ? Pin
Member 1487416726-Jun-20 8:26
Member 1487416726-Jun-20 8:26 
I have a jframe with a jcomboBox and two buttons, the first button allows to add dynamically jcomboBoxes and the second to generate the RDF file.
the elements of comboBoxes are URIs that I extracted from an ontology.
My goal is to generate an RDF file to describe the URIs of the comboBoxes, for example I add 3 comboBoxes to my jframe by clicking on the button "add comboBox" so the final jframe will have 4 comboBoxes, for each combBoxes, I select a different URI and I click on the "generate RDF" button to generate the RDF file, but the problem is that it only works for the first URI and the other three URIs will be identical.
this is my code to add combBoxes :

Java
 add.addActionListener (new ActionListener () {
public void actionPerformed (ActionEvent e) {
c4 = new JComboBox ();
req1 ();
panel_2.add (c4);
panel_2.revalidate ();
}

this is my code to generate RDF file :
Java
<pre>btnGenerateRdf.addActionListener (new ActionListener () {
public void actionPerformed (ActionEvent arg0) {
String u = c2.getSelectedItem (). ToString ();
String uu = c4.getSelectedItem (). ToString ();

Model model = ModelFactory.createDefaultModel ();
String u1 = u.substring (u.lastIndexOf ("#") + 1);
String str = u1.replace ('_', '');
String uu1 = uu.substring (uu.lastIndexOf ("#") + 1);
String str1 = uu1.replace ('_', '');
    

Resource node = model.createResource (u)
.addProperty (VCARD.N,
model.createResource ()
.addProperty (FOAF.name, str));


Resource node1 = model.createResource (uu)
.addProperty (VCARD.N,
model.createResource ()
.addProperty (FOAF.name, str1));



Resource node11 = model.createResource (uu)
.addProperty (VCARD.N,
model.createResource ()
.addProperty (FOAF.name, str1));
String s = c4.getSelectedItem (). ToString ();
if (add.getActionListeners ()! = null)
{
Resource [] nodes = new Resource [panel_2.getComponentCount () - 2];
for (int i = 0; i <panel_2.getComponentCount () - 2; i ++)

{
String s1 = s.substring (s.lastIndexOf ("#") + 1); // to get the final substring
String s2 = s1.replace ('_', '');
nodes [i] = model.createResource (s)
.addProperty (VCARD.N,
model.createResource ()
.addProperty (FOAF.name, s2));


}}


try {
FileOutputStream fout = new FileOutputStream ("C: \\ Users \\ me \\ Desktop \\ file2.xml");
model.write (fout);
} catch (IOException e) {
System.out.println ("Exception caught" + e.getMessage ());
}
}
});

how can i fix this?
AnswerRe: How to dynamically RDF resources in java ? Pin
Richard MacCutchan26-Jun-20 22:24
mveRichard MacCutchan26-Jun-20 22:24 
QuestionNeed help to simplify the solution Pin
User-862169523-Jun-20 18:02
User-862169523-Jun-20 18:02 
AnswerRe: Need help to simplify the solution Pin
Richard MacCutchan23-Jun-20 21:53
mveRichard MacCutchan23-Jun-20 21:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.