{"id":841,"date":"2004-06-07T15:51:33","date_gmt":"2004-06-07T19:51:33","guid":{"rendered":"\/?p=841"},"modified":"2004-06-07T15:51:33","modified_gmt":"2004-06-07T19:51:33","slug":"buoy-10","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2004\/06\/07\/buoy-10\/","title":{"rendered":"Buoy 1.0"},"content":{"rendered":"<p>\r\n<a href=\"http:\/\/buoy.sourceforge.net\/AboutBuoy.html\">Buoy<\/a> is an interesting public-domain wrapper for Swing. It uses reflection to let you create Cocoa-style connections between event generators and event handlers, without the cruft of using interfaces and anonymous adapter classes. For instance, the Java:\r\n<\/p>\r\n\r\n<pre>\r\nwidget.addEventLink(ActionEvent.class, obj, \"doSomething\");\r\n<\/pre>\r\n\r\n<p>\r\nis loosely equivalent to the Objective-C:\r\n<\/p>\r\n\r\n<pre>\r\n[widget setTarget:obj];\r\n[widget setAction:@selector(doSomething:)];\r\n<\/pre>\r\n\r\n<p>\r\nSeveral benefits fall out of this design, and Buoy also makes other improvements to Swing. For instance, (like Cocoa) Buoy doesn&rsquo;t generate events when you manipulate widgets programmatically.\r\n<\/p>\r\n\r\n<p>\r\nI don&rsquo;t write Swing code anymore, but if I did I&rsquo;d surely want to use something like Buoy.\r\n<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Buoy is an interesting public-domain wrapper for Swing. It uses reflection to let you create Cocoa-style connections between event generators and event handlers, without the cruft of using interfaces and anonymous adapter classes. For instance, the Java: widget.addEventLink(ActionEvent.class, obj, \"doSomething\"); is loosely equivalent to the Objective-C: [widget setTarget:obj]; [widget setAction:@selector(doSomething:)]; Several benefits fall out of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-841","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=841"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/841\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}