{"id":10397,"date":"2015-08-28T07:56:06","date_gmt":"2015-08-28T11:56:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/?p=10397"},"modified":"2015-08-24T09:59:07","modified_gmt":"2015-08-24T13:59:07","slug":"draws-a-filled-ellipse","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=10397","title":{"rendered":"Draws a filled ellipse"},"content":{"rendered":"<pre>import javax.swing.*;\u00a0\u00a0 \/\/ For JPanel, etc.\r\nimport java.awt.*;\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ For Graphics, etc.\r\nimport java.awt.geom.*; \/\/ For Ellipse2D, etc.\r\n\r\n\/** An example of drawing\/filling shapes with Java 2D in\r\n\u00a0*\u00a0 Java 1.2 and later.\r\n\u00a0*\r\n**************************\r\npublic class ShapeExample extends JPanel {\r\n\u00a0 private Ellipse2D.Double circle =\r\n\u00a0\u00a0\u00a0 new Ellipse2D.Double(10, 10, 350, 350);\r\n\u00a0 private Rectangle2D.Double square =\r\n\u00a0\u00a0\u00a0 new Rectangle2D.Double(10, 10, 350, 350);\r\n\r\n\u00a0 public void paintComponent(Graphics g) {\r\n\u00a0\u00a0\u00a0 clear(g);\r\n\u00a0\u00a0\u00a0 Graphics2D g2d = (Graphics2D)g;\r\n\u00a0\u00a0\u00a0 g2d.fill(circle);\r\n\u00a0\u00a0\u00a0 g2d.draw(square);\r\n\u00a0 }\r\n\r\n\u00a0 \/\/ super.paintComponent clears off screen pixmap,\r\n\u00a0 \/\/ since we're using double buffering by default.\r\n\u00a0 protected void clear(Graphics g) {\r\n\u00a0\u00a0\u00a0 super.paintComponent(g);\r\n\u00a0 }\r\n\r\n\u00a0 protected Ellipse2D.Double getCircle() {\r\n\u00a0\u00a0\u00a0 return(circle);\r\n\u00a0 }\r\n\r\npublic static void main(String[] args) {\r\n\u00a0\u00a0\u00a0 WindowUtilities.openInJFrame(new ShapeExample(), 380, 400);\r\n\u00a0 }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import javax.swing.*;\u00a0\u00a0 \/\/ For JPanel, etc. import java.awt.*;\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ For Graphics, etc. import java.awt.geom.*; \/\/ For Ellipse2D, etc. \/** An example of drawing\/filling shapes with Java 2D in \u00a0*\u00a0 Java 1.2 and later. \u00a0* ************************** public class ShapeExample extends JPanel { \u00a0 private Ellipse2D.Double circle = \u00a0\u00a0\u00a0 new Ellipse2D.Double(10, 10, 350, 350); \u00a0 private Rectangle2D.Double &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=10397\">Continue reading<\/a><\/p>\n","protected":false},"author":130,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1417,1424],"tags":[706,308,285],"class_list":["post-10397","post","type-post","status-publish","format-standard","hentry","category-code-programming-samples--","category-javaj2eej2me","tag-code","tag-java","tag-285","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":26876,"url":"http:\/\/bangla.sitestree.com\/?p=26876","url_meta":{"origin":10397,"position":0},"title":"Draws a filled ellipse #Programming Code Examples #Java\/J2EE\/J2ME #Drawing","author":"Author-Check- Article-or-Video","date":"May 4, 2021","format":false,"excerpt":"import javax.swing.*; \/\/ For JPanel, etc. import java.awt.*; \/\/ For Graphics, etc. import java.awt.geom.*; \/\/ For Ellipse2D, etc. \/** An example of drawing\/filling shapes with Java 2D in * Java 1.2 and later. * ************************** public class ShapeExample extends JPanel { private Ellipse2D.Double circle = new Ellipse2D.Double(10, 10, 350, 350);\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10146,"url":"http:\/\/bangla.sitestree.com\/?p=10146","url_meta":{"origin":10397,"position":1},"title":"PluginApplet.jsp Page that demonstrates the use of jsp:plugin.","author":"","date":"August 12, 2015","format":false,"excerpt":"PluginApplet.jsp\u00a0 Page that demonstrates the use of jsp:plugin. Requires you to compile and install PluginApplet.java, TextPanel.java, DrawingPanel.java, and WindowUtilities.java\u00a0 Since these are classes sent to the client to used by applets, the .class files should be in the same directory as the JSP page, not in the WEB-INF\/classes directory where\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26818,"url":"http:\/\/bangla.sitestree.com\/?p=26818","url_meta":{"origin":10397,"position":2},"title":"PluginApplet.jsp  Page that demonstrates the use of jsp:plugin. #Programming Code Examples #Java\/J2EE\/J2ME #JSP","author":"Author-Check- Article-or-Video","date":"May 2, 2021","format":false,"excerpt":"PluginApplet.jsp Page that demonstrates the use of jsp:plugin. Requires you to compile and install PluginApplet.java, TextPanel.java, DrawingPanel.java, and WindowUtilities.java Since these are classes sent to the client to used by applets, the .class files should be in the same directory as the JSP page, not in the WEB-INF\/classes directory where\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26890,"url":"http:\/\/bangla.sitestree.com\/?p=26890","url_meta":{"origin":10397,"position":3},"title":"LineStyles.java Provides examples of the available styles for joining line segments #Programming Code Examples #Java\/J2EE\/J2ME #Drawing","author":"Author-Check- Article-or-Video","date":"May 4, 2021","format":false,"excerpt":"import javax.swing.*; import java.awt.*; import java.awt.geom.*; \/** A demonstration of different controls when joining two line * segments. The style of the line end point is controlled * through the capStyle parameter. * ************************************ public class LineStyles extends JPanel { private GeneralPath path; private static int x = 30, deltaX\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10417,"url":"http:\/\/bangla.sitestree.com\/?p=10417","url_meta":{"origin":10397,"position":4},"title":"ShearExample.java. Illustrates the effect of applying a shear transformation prior to drawing a square","author":"","date":"August 28, 2015","format":false,"excerpt":"import javax.swing.*; import java.awt.*; import java.awt.geom.*; \/** An example of shear transformations on a rectangle. \u00a0* \u00a0*********************** public class ShearExample extends JPanel { \u00a0 private static int gap=10, width=100; \u00a0 private Rectangle rect = new Rectangle(gap, gap, 100, 100); \u00a0 public void paintComponent(Graphics g) { \u00a0\u00a0\u00a0 super.paintComponent(g); \u00a0\u00a0\u00a0 Graphics2D g2d\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10404,"url":"http:\/\/bangla.sitestree.com\/?p=10404","url_meta":{"origin":10397,"position":5},"title":"Illustrates the effect of different transparency","author":"","date":"August 28, 2015","format":false,"excerpt":"~~~~~~~~~~~~~~~~~~~ TransparencyExample.java Illustrates the effect of different transparency (alpha) values when drawing a shape. ~~~~~~~~~~~~~~~~~~~ import javax.swing.*; import java.awt.*; import java.awt.geom.*; \/** An illustration of the use of AlphaComposite to make \u00a0*\u00a0 partially transparent drawings. \u00a0* \u00a0********************************** public class TransparencyExample extends JPanel { \u00a0 private static int gap=10, width=60, offset=20,\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/130"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10397"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10397\/revisions"}],"predecessor-version":[{"id":10399,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10397\/revisions\/10399"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10397"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}