Showing posts with label Swing. Show all posts
Showing posts with label Swing. Show all posts

2/8/11

Syntax Highlighter installed.

Trying out this here for syntax highlightning...

// Test JavaScript looking good
function foo()
{
   if (counter <= 10)
      return;
} 

Editing Design | HTML must add brush for Scala:
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js' type='text/javascript'/>  

Simple Scala-Swing example:
package helloscala
import swing._

object SimpleTextView extends Frame {    
    title = "Simple Text View"
    location = new java.awt.Point( 200,100 )
    minimumSize = new java.awt.Dimension(600, 400)

    var outArea : TextArea =  new TextArea;
    showText("")

    def showText(sometext:String) = {
        outArea.font = new java.awt.Font("Arial", java.awt.Font.BOLD, 12)
        outArea.text = sometext
       
        contents = outArea
        open
    }
    def addText(moretext:String) = {
        outArea.text += moretext
    }
    def writeln(moretext:String) = addText(moretext+"\n")

}