Examples of JSyntaxHighlighter


Examples of chrriis.dj.nativeswing.swtimpl.components.JSyntaxHighlighter

//                              sourcePanel.add(new JScrollPane(new SourcePane(reader)), BorderLayout.CENTER);
                              StringBuilder sb = new StringBuilder();
                              char[] chars = new char[1024];
                              for(int i; (i=reader.read(chars)) != -1; sb.append(chars, 0, i)) {
                              }
                              JSyntaxHighlighter syntaxHighlighter = new JSyntaxHighlighter();
                              syntaxHighlighter.setContent(sb.toString(), ContentLanguage.Java);
                              sourcePanel.add(syntaxHighlighter, BorderLayout.CENTER);
                              sourcePanel.revalidate();
                              sourcePanel.repaint();
                              reader.close();
                            } catch(Exception ex) {
View Full Code Here

Examples of chrriis.dj.nativeswing.swtimpl.components.JSyntaxHighlighter

public class SimpleSyntaxHighlighterExample {

  private static final String LS = Utils.LINE_SEPARATOR;

  public static JComponent createContent() {
    JSyntaxHighlighter syntaxHighlighter = new JSyntaxHighlighter();
    syntaxHighlighter.setContent(
        "/************************" + LS +
        " * This is some C# code *" + LS +
        " ************************/" + LS +
        "public class Foo" + LS +
        "{" + LS +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.