javalover520 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Run Time error #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello 
I am trying to integrate your project with my program given here below
import javax.swing.*;
import java.awt.*;
import java.io.*;

import jsyntaxpane.*;
import jsyntaxpane.lexers.*;
import jsyntaxpane.syntaxkits.*;
import jsyntaxpane.util.*;

class TestEditor
{

   public static void main(String[] args)
   {
      try 
      {
         jsyntaxpane.DefaultSyntaxKit.initKit();

         JEditorPane editorPane = new JEditorPane("text", "yahoo");
         editorPane.setEditable(true);
         editorPane.setEditorKit(new SqlSyntaxKit());
         editorPane.setContentType("text/sql");

         JFrame frame = new JFrame();
         frame.getContentPane().add(editorPane, BorderLayout.CENTER);
         frame.setSize(1000, 1000);
         frame.setVisible(true);
      } 
      catch (Exception e) 
      {
      }
   }

}

It compiles well . But when I run it from Terminal it throws the following
error . 

imac02:~/Desktop/idv tverma$ java TestEditor
Exception in thread "main" java.lang.NoSuchMethodError:
java.util.Properties.stringPropertyNames()Ljava/util/Set;
        at jsyntaxpane.DefaultSyntaxKit.initKit(DefaultSyntaxKit.java:118)
        at jsyntaxpane.DefaultSyntaxKit.<clinit>(DefaultSyntaxKit.java:44)
        at TestEditor.main(TestEditor.java:20)

My dir structure is 
imac02:~/Desktop/idv tverma$ ls
TestEditor.class        TestEditor.java         jsyntaxpane-0.9.0.jar

My java version is  1.5
imac02:~/Desktop/idv tverma$ java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)

Can you please help me understand about where am I going incorrect.

Thank you 
Tarun Verma. 

Original issue reported on code.google.com by tarunverma82 on 25 Sep 2008 at 3:11

GoogleCodeExporter commented 8 years ago
You do not need the line:
         editorPane.setEditorKit(new SqlSyntaxKit());
As of 0.9.0, that should not be used if you use editorPane.setContentType
I am using JDK 1.6 for everything, you may have issues with 1.5.  If the above 
does
not work, then can you compile the sources in 1.5?

Original comment by ayman.al...@gmail.com on 25 Sep 2008 at 6:35

GoogleCodeExporter commented 8 years ago
I just noticed that I'm using a new method of the Properties class added in 
1.6.  So
you will need 1.6.

Original comment by ayman.al...@gmail.com on 25 Sep 2008 at 6:41