JRuby Profligacy,JDialog dispose

时间:2014-02-08 17:19:17

标签: ruby swing jruby jdialog

我试图在JButton中触发JDialog#dispose

class SettingsDialog < JDialog
  include_package 'javax.swing'
  include Profligacy
  def initialize(frame, modal)
     layout = "[ save ]"


    @ui = Swing::LEL.new(JFrame, layout) do |c, i|
      c.save = @save_button = JButton.new "Save"
      i.save = { action: method(:save) }
    end
  end

  def save(type, event)
    self.dispose
  end
end

输出为:nothing :(并且JDialog仍然打开

我做错了什么?

0 个答案:

没有答案