Changeset 6931 for lang/scala

Show
Ignore:
Timestamp:
02/19/08 18:59:24 (9 months ago)
Author:
kmizu
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/scala/sandbox/src/jp/gr/java_conf/mizu/gui/GUIBuilder.scala

    r6924 r6931  
    99import javax.swing.JFrame 
    1010import javax.swing.JButton 
     11import javax.swing.JTextField 
    1112import javax.swing.Action 
    1213import javax.swing.AbstractAction 
     
    4748                case text:String => button.setText(text) 
    4849    case handler:ActionListener => button.addActionListener(handler) 
    49                 case (property:Symbol, value:Any) => setProperty(button, property, value) 
     50                case (property:Symbol, value) => setProperty(button, property, value) 
    5051                } 
    5152                button 
    5253        } 
     54  def textField(params :Any*) :JTextField = { 
     55     val widget = new JTextField 
     56     asContainer.add(widget) 
     57     params.foreach { 
     58     case text:String => widget.setText(text) 
     59     case (property:Symbol, value) => setProperty(widget, property, value) 
     60     } 
     61     widget 
     62  } 
    5363        def action(handler :ActionEvent => Unit) :ActionListener = { 
    5464    new ActionListener {