Cheri: Builder-style JRuby/Swing GUI development - RUBY

This is a discussion on Cheri: Builder-style JRuby/Swing GUI development - RUBY ; Ara mentioned wanting to hear more about Swing-based GUI stuff in JRuby, so here's a quick intro to some of the frameworks available right now for doing Swing stuff. I'd like to know what people think of these and what's ...

+ Reply to Thread
Results 1 to 3 of 3

Cheri: Builder-style JRuby/Swing GUI development

  1. Default Cheri: Builder-style JRuby/Swing GUI development

    Ara mentioned wanting to hear more about Swing-based GUI stuff in JRuby,
    so here's a quick intro to some of the frameworks available right now
    for doing Swing stuff. I'd like to know what people think of these and
    what's missing. There's a bunch, so I'll do this as separate posts.

    * Cheri (http://cheri.rubyforge.org/)

    "Cheri is a framework for creating builder applications; that is,
    applications that build or represent hierarchical, tree-like,
    structures, using a declarative syntax. Cheri includes a number of
    builders based on the framework, as well as a builder–builder for easily
    creating new builders or extending existing builders. Cheri also comes
    with a demo application, Cheri::JRuby::Explorer (CJX), that is built
    using two of the supplied builders (Cheri::Swing and Cheri::Html)."

    Cheri is very much a builder for Swing, hiding most aspects of the Swing
    component behind a declarative language. So here's a simple example:

    Hello World:

    @frame = swing.frame('Hello World') {|obj|
    size 200,150; box_layout obj, :Y_AXIS
    on_window_closing { puts 'bye!'; @frame.dispose }
    y_glue
    x_box { label 'Hello!' }
    y_glue
    }
    @frame.visible = true

    A simple HTML example:

    require 'cheri/swing'
    require 'cheri/html'
    include Cheri::Swing
    include Cheri::Html

    folks = {
    "Susan" =>"Wife", "Larry" =>"Son",
    "Bob" => "Friend","MaryAnne" => "Friend",
    }
    @frame = swing.frame('Swing and Html') { |frm|
    size 240,180; box_layout frm,:Y_AXIS
    content_pane { background :WHITE }
    default_close_operation :EXIT_ON_CLOSE
    menu_bar {
    menu('File') { mnemonic :VK_F
    menu_item('Exit') { mnemonic :VK_X
    on_click { @frame.dispose }
    }}}
    scroll_pane {
    align :LEFT
    editor_pane {
    content_type 'text/html'
    editable false
    background color(255,255,240)
    html {head {
    style "body { font-family: sans-serif; }" }
    body {div(:align=>:center) {
    table(:width=>'90%',:border=>1) {
    tr th('Name'), th('Relationship'),
    :bgcolor=>:yellow
    folks.each do |name,rel|
    tr(:bgcolor=>'#e0ffff') {
    td {name}; td {rel} }
    end
    }}}}}}
    }
    @frame.visible = true

    - Charlie


  2. Default Re: Cheri: Builder-style JRuby/Swing GUI development

    On 10/29/07, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
    I am very happy with your decision to post a lot about JRuby, I feel
    this is an absolute feat for the list.

    It would however put a cherry on top of the whipped cream if you
    labeled your posts [JRuby], well it would be my cherry, how do others
    feel about this idea?

    Cheers
    Robert

    --
    what do I think about Ruby?
    http://ruby-smalltalk.blogspot.com/


  3. Default Re: Cheri: Builder-style JRuby/Swing GUI development

    Robert Dober wrote:
    > On 10/29/07, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
    > I am very happy with your decision to post a lot about JRuby, I feel
    > this is an absolute feat for the list.
    >
    > It would however put a cherry on top of the whipped cream if you
    > labeled your posts [JRuby], well it would be my cherry, how do others
    > feel about this idea?


    I can certainly do that, at least when it's a purely informational post.
    But I may forget sometimes

    - Charlie


+ Reply to Thread

Similar Threads

  1. [JRuby] Ruby and Swing: Profligacy
    By Application Development in forum RUBY
    Replies: 0
    Last Post: 10-31-2007, 01:16 PM
  2. Swing Bean Form Builder (SBFB) 0.1 released
    By Application Development in forum Java
    Replies: 1
    Last Post: 05-25-2006, 05:06 PM
  3. Replies: 0
    Last Post: 06-19-2004, 01:27 AM
  4. SMaker, the XML based GUI builder tool for Java[TM] Swing
    By Application Development in forum Java
    Replies: 0
    Last Post: 10-26-2003, 02:34 PM
  5. jvider 1.6 - GUI builder for Java Swing
    By Application Development in forum Java
    Replies: 0
    Last Post: 09-19-2003, 09:43 AM