Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8171617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:30:56+00:00 2026-06-06T21:30:56+00:00

I decided to check out JRuby and JOGL to see if I could get

  • 0

I decided to check out JRuby and JOGL to see if I could get some graphics sim stuff running. I’ve got the classpath set up and the OpenGL things included properly. Following some tutorials, they suggest using an AWT frame instead of a Swing one, as Swing won’t support graphics acceleration (which is really what I’m looking for).

I can’t figure out how to close the AWT frame from Ruby, however. I have a WindowAdapter that fires a Kernel.exit event when the close button on the frame is clicked. It looks like this:

class Controller < WindowAdapter
  def windowClosing(event)
    Kernel.exit
  end
end

The Frame adds this with add_window_listener(Controller.new). The event successfully fires when I click the close button, but it spits out the following error:

Exception in thread "AWT-EventQueue-0" org.jruby.exceptions.RaiseException: (SystemExit) exit

Calling Kernel.exit from the Frame’s initialize successfully exits the program. So I’m not sure why calling it from the listener fails. I know in java you can define an anonymous WindowAdapter inline, but I have no idea what the syntax for that would be in Ruby.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:30:57+00:00Added an answer on June 6, 2026 at 9:30 pm

    I did some extra searching and experimentation and found an answer. It appears to be a quirk of the Ruby implementation in the JVM. Calling exit or Kernel.exit from inside the WindowAdapter is useless.

    Calling java.lang.System.exit(0), however, does work. I’m not sure why the distinction should make a difference. I would expect exit to alias to the Java system command, but it apparently doesn’t Hope this is helpful to anyone else who might run into the same problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After laying out some ideas in Processing, I've decided to move my MIDI project
I have decided to check out Emacs, and I liked it very much. Now,
I was going through following article http://www.codexterity.com/delphistrings.htm So, I decided to check out the
I am setting up a World Cup Challenge between some friends, and decided to
My boss decided recently to try out an outsourcing group for increased capacity as
Going through some excercises to hone my binary tree skills, I decided to implement
First of all I know this is a duplicated question and I check out
EDIT: Reworked my code a bit and decided to throw out URLLoader in favor
Edit: I decided to take the LINQ to XML approach (see the answer below)
So I've run into something and was wondering if you could help me out.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.