Skip to content
Speljohan edited this page Mar 17, 2013 · 1 revision

View Components

This is a list of all currently used View Components. This list may change at any time.

  • button - A standard button.
  • label - Just a regular old label.
  • checkbox - You guessed it, a standard checkbox :)

These all map to their respective swing components in Java, and have aliases set up to simplify it.

For example, to declare a new button, you would do:

JButton button = new JButton(); // Creates a new button
button.setText("My text"); // Sets the text of the button
System.out.println(button.getText()); // Prints the text of the button
myView.add(button);

In SVEN, you simply do:

button do # Creates a new button
  text "My text" # Sets the text of the button
  puts text? # Prints the text of the button
end

Clone this wiki locally