Package chrriis.dj.nativeswing.swtimpl.components

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


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

Related Classes of chrriis.dj.nativeswing.swtimpl.components.JSyntaxHighlighter

Copyright © 2018 www.massapicom. 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.