{"id":1252,"date":"2014-10-13T12:05:50","date_gmt":"2014-10-13T10:05:50","guid":{"rendered":"http:\/\/liceocuneo.it\/oddenino\/?p=1252"},"modified":"2014-10-13T12:05:50","modified_gmt":"2014-10-13T10:05:50","slug":"agitazione-termica","status":"publish","type":"post","link":"https:\/\/liceocuneo.it\/oddenino\/agitazione-termica\/","title":{"rendered":"Agitazione termica"},"content":{"rendered":"<pre>public class H2O extends JComponent implements Runnable {\r\n\r\n    private int dx = 0, dy = 0;\r\n\r\n    public H2O() {\r\n        this.setPreferredSize(new Dimension(100, 100));\r\n        Thread thread = new Thread(this);\r\n        thread.setDaemon(true);\r\n        thread.start();\r\n    }\r\n\r\n    @Override\r\n    public void paintComponent(Graphics g) {\r\n        super.paintComponent(g);\r\n\r\n        g.setColor(Color.BLUE);\r\n        g.fillOval(60 + dx, 50 + dy, 10, 10);\r\n        g.fillOval(50 + dx, 60 + dy, 10, 10);\r\n        g.setColor(Color.RED);\r\n        g.fillOval(45 + dx, 45 + dy, 20, 20);\r\n    }\r\n\r\n    @Override\r\n    public void run() {\r\n        while (true) {\r\n            dx = (int) (Math.random() * 20 - 10);\r\n            dy = (int) (Math.random() * 20 - 10);\r\n            repaint();\r\n            try {\r\n                Thread.sleep(50);\r\n            } catch (InterruptedException ex) {\r\n            }\r\n        }\r\n    }\r\n\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>public class H2O extends JComponent implements Runnable { private int dx = 0, dy = 0; public H2O() { this.setPreferredSize(new Dimension(100, 100)); Thread thread = new Thread(this); thread.setDaemon(true); thread.start(); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.BLUE); g.fillOval(60 + dx, 50 + dy, 10, 10); g.fillOval(50 + dx, 60 + dy, 10, 10); g.setColor(Color.RED); &hellip; <a href=\"https:\/\/liceocuneo.it\/oddenino\/agitazione-termica\/\" class=\"more-link\">Continua a leggere <span class=\"screen-reader-text\">Agitazione termica<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1252","post","type-post","status-publish","format-standard","hentry","category-informatica"],"_links":{"self":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/posts\/1252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/comments?post=1252"}],"version-history":[{"count":0,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/posts\/1252\/revisions"}],"wp:attachment":[{"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/media?parent=1252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/categories?post=1252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liceocuneo.it\/oddenino\/wp-json\/wp\/v2\/tags?post=1252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}