{"id":1067,"date":"2015-09-15T00:13:33","date_gmt":"2015-09-15T00:13:33","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=1067"},"modified":"2015-09-15T00:13:33","modified_gmt":"2015-09-15T00:13:33","slug":"anychart-java-swt","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/","title":{"rendered":"AnyChart and Java Standard Widget Toolkit (SWT)"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>The <a href='https:\/\/en.wikipedia.org\/wiki\/Standard_Widget_Toolkit' target='_blank' target=\"_blank\" rel=\"nofollow\">Standard Widget Toolkit (SWT)<\/a> is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the <a href='https:\/\/en.wikipedia.org\/wiki\/Abstract_Window_Toolkit' target='_blank' target=\"_blank\" rel=\"nofollow\">Abstract Window Toolkit (AWT)<\/a> and <a href='https:\/\/en.wikipedia.org\/wiki\/Swing_(Java)' target='_blank' target=\"_blank\" rel=\"nofollow\">Swing Java GUI<\/a> toolkits provided by Oracle as part of the Java Platform.<\/p>\n<p>We have created a basic sample to show how you can work with AnyChart in an SWT application.<\/p>\n<h3>Contents and Launching<\/h3>\n<p><a href='https:\/\/www.anychart.com\/demos\/swt\/anychart-java-swt-example.zip' target='_blank'>The sample file<\/a> (click to download) contains the <b>&#8216;src&#8217;<\/b> folder with the source code and the <b>&#8216;jar&#8217;<\/b> file. You can run the file using the <b>java -jar &lt;jar_file_name&gt;<\/b> command.<\/p>\n<p>In Mac OS X you can launch the sample like this:<br \/>\n<code>java -XstartOnFirstThread -jar anychart-java-example.jar<\/code><\/p>\n<p>In Windows you can do that like this:<br \/>\n<code>java -jar anychart-java-example.jar<\/code><\/p>\n<h3>Description<\/h3>\n<p>This sample shows a basic chart with five points. It listens for the chart draw and point hover events, and logs them into the <i>textArea<\/i> on the page; anychart.min.js is loaded from <a href='https:\/\/cdn.anychart.com\/' target='_blank' target=\"_blank\" rel=\"nofollow\">AnyChart CDN<\/a>.<\/p>\n<p>The &#8216;Add Random Point&#8217; button keeps adding random points until the total point count is 20 and after then removes one point before adding a new one.<\/p>\n<p>Source code is rather simple and self-descriptive, and there are only two things you should look at:<br \/>\nThe <i>static String myScript<\/i> variable defines what script is executed when button is clicked;<br \/>\nThe <i>static String createHTML()<\/i> method generates HTML and puts it into the browser window.<\/p>\n<h3>Summary<\/h3>\n<p>AnyChart and Java Standard Widget Toolkit (SWT) Sample: <a href='https:\/\/www.anychart.com\/demos\/swt\/anychart-java-swt-example.zip' target='_blank'>anychart-java-swt-example.zip<\/a><br \/>\nAnyChart Download: <a href='https:\/\/www.anychart.com\/download\/' target='_blank'>https:\/\/www.anychart.com\/download\/<\/a><br \/>\nAnyChart Documentation: <a href='https:\/\/docs.anychart.com\/download\/' target='_blank' target=\"_blank\" rel=\"nofollow\">https:\/\/docs.anychart.com\/<\/a><br \/>\nAnyChart API: <a href='https:\/\/api.anychart.com\/' target='_blank' target=\"_blank\" rel=\"nofollow\">https:\/\/api.anychart.com\/<\/a><br \/>\nAnyChart Overview: <a href='https:\/\/www.anychart.com\/' target='_blank'>AnyChart Web Charts JavaScript Framework<\/a><\/p>\n<p>Later we will extend the sample, add more features, and show how to achieve more with AnyChart in Java environment. We also have a number of other samples coming up. <\/p>\n<p>If you created anything with AnyChart in Java applications and are ready to share &#8211; please drop us a line in comments, on <a href='https:\/\/www.facebook.com\/AnyCharts' target='_blank' target=\"_blank\" rel=\"nofollow\">Facebook<\/a>, <a href='https:\/\/twitter.com\/AnyChart' target=\"_blank\" rel=\"nofollow\">Twitter<\/a>, or via email (<a href='mailto:support@anychart.com' target=\"_blank\" rel=\"nofollow\">support@anychart.com<\/a>).<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Overview The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the Abstract Window Toolkit (AWT) and Swing Java GUI toolkits [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"class_list":["post-1067","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-tips-and-tricks","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AnyChart and Java Standard Widget Toolkit (SWT) | AnyChart News<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AnyChart and Java Standard Widget Toolkit (SWT) | AnyChart News\" \/>\n<meta property=\"og:description\" content=\"Overview The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the Abstract Window Toolkit (AWT) and Swing Java GUI toolkits [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\" \/>\n<meta property=\"og:site_name\" content=\"AnyChart News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AnyCharts\" \/>\n<meta property=\"article:published_time\" content=\"2015-09-15T00:13:33+00:00\" \/>\n<meta name=\"author\" content=\"Timothy Loginov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:site\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Timothy Loginov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\"},\"author\":{\"name\":\"Timothy Loginov\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6\"},\"headline\":\"AnyChart and Java Standard Widget Toolkit (SWT)\",\"datePublished\":\"2015-09-15T00:13:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\"},\"wordCount\":350,\"commentCount\":3,\"articleSection\":[\"AnyChart Charting Component\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\",\"name\":\"AnyChart and Java Standard Widget Toolkit (SWT) | AnyChart News\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"datePublished\":\"2015-09-15T00:13:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AnyChart and Java Standard Widget Toolkit (SWT)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\",\"url\":\"https:\/\/www.anychart.com\/blog\/\",\"name\":\"AnyChart News\",\"description\":\"AnyChart JS Charts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.anychart.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6\",\"name\":\"Timothy Loginov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g\",\"caption\":\"Timothy Loginov\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/timothy-loginov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AnyChart and Java Standard Widget Toolkit (SWT) | AnyChart News","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/","og_locale":"en_US","og_type":"article","og_title":"AnyChart and Java Standard Widget Toolkit (SWT) | AnyChart News","og_description":"Overview The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the Abstract Window Toolkit (AWT) and Swing Java GUI toolkits [&hellip;]","og_url":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2015-09-15T00:13:33+00:00","author":"Timothy Loginov","twitter_card":"summary_large_image","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Timothy Loginov","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/"},"author":{"name":"Timothy Loginov","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6"},"headline":"AnyChart and Java Standard Widget Toolkit (SWT)","datePublished":"2015-09-15T00:13:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/"},"wordCount":350,"commentCount":3,"articleSection":["AnyChart Charting Component","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/","url":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/","name":"AnyChart and Java Standard Widget Toolkit (SWT) | AnyChart News","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"datePublished":"2015-09-15T00:13:33+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6"},"breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2015\/09\/15\/anychart-java-swt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AnyChart and Java Standard Widget Toolkit (SWT)"}]},{"@type":"WebSite","@id":"https:\/\/www.anychart.com\/blog\/#website","url":"https:\/\/www.anychart.com\/blog\/","name":"AnyChart News","description":"AnyChart JS Charts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.anychart.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/a944a69f34509440ab4a9b5ead73caa6","name":"Timothy Loginov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/00860a412d134244a5234231874065a30044d4d59f78aef4cca746e1e2dd3691?s=96&r=g","caption":"Timothy Loginov"},"url":"https:\/\/www.anychart.com\/blog\/author\/timothy-loginov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/1067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=1067"}],"version-history":[{"count":22,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/1067\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/1067\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=1067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=1067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=1067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}