Re: fillPolygon code from Graphics Programming Software Development by mKorbel …setColor(color); g.translate(x, y); if (selected) { g.fillPolygon(poly1); } else { g.drawPolygon(poly2); } g.translate(-x, …= {y + 10, y, y, y + 10}; g.fillPolygon(t_x, t_y, t_x.length); g.fillRect(x, y + 10… Re: fillPolygon code from Graphics Programming Software Development by JamesCherrill … OP was asking where to find the source code for fillPolygon. It's defined in Graphics, but its abstract. Graphics2D doesn… fillPolygon code from Graphics Programming Software Development by nataraja833 Hi , Can anyone point me to fillPolygon source code , In Graphics.java it is declared as abstract class . - Nataraja G Re: fillPolygon code from Graphics Programming Software Development by JamesCherrill Interesting question. A quick Google doesnt reveal any subclasses for Graphics2d - maybe they are private? You could do something that gives you a Graphics2d object (eg overide paintComponent) then test the runtime variable to see exactly what class it really is. With the actual class name it may be easier to track down the source. Please post … Re: fillPolygon code from Graphics Programming Software Development by mKorbel my view - original Java by Sun was about enthusiasm, tons of API has lack in descriptions (authors of description were inspired by MSDN:-) - almost, maybe all methods used for [Graphics](http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html)/[Graphics2D](http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics2D.html), available in … Re: fillPolygon code from Graphics Programming Software Development by jwenting (Most likely) the actual implementation is inside the JVM and is platform specific. http://openjdk.java.net/groups/2d/ is the implementation project of the openjdk variant of Java2D. Re: fillPolygon code from Graphics Programming Software Development by nataraja833 Hello , Thanks for your help , I was not able to find the code . used anyother workaround which is not efficient. background of this problem : I'm drawing multiple Rect/Polygons on JPanel and few Rect/Poly are filled with TexturePatterns wherein brackground is black and patterns(45/135 lines) are drawn in some colour… Re: fillPolygon code from Graphics Programming Software Development by JamesCherrill Why didn't you say that in the first place? Just setOpaque(false) on your JPanel, and instead of black use any color with an alpha value of 0 (which means fully transparent) Re: fillPolygon code from Graphics Programming Software Development by nataraja833 Hi James , I'm quite new to Java/Swing so I didn't know all these features ! *"instead of black use any color with an alpha value of 0 "* I'm not sure what this means , tried googling . below is the code snippet , can you kindly enlighten me Rectangle r = new Rectangle(0, 0, texture_size, texture_size); for ( Color … Re: fillPolygon code from Graphics Programming Software Development by JamesCherrill Change the BufferedImage to `TYPE_INT_ARGB` (RGB plus alpha channel). The alpha value (0-255) specifies how opaque the color is. Instead of black, use a totally transparent color, eg `new Color(0,0,0,0)` (the fourth parameter is the alpha value) and finally make the JPanel transparent (not opaque) using `setOpaque(false)` Re: fillPolygon code from Graphics Programming Software Development by nataraja833 Thanks James , I'll give it a try . - Nataraja G Re: fillPolygon code from Graphics Programming Software Development by nataraja833 Hello , It worked as expected , thanks James . I'll look into offset issues . - Nataraja G Re: fillPolygon code from Graphics Programming Software Development by nataraja833 Hello , Just an update,filling rectangles with ( fillRect + ARGB TexturePaint ) has more runtime than ( drawRect + 45 degree lines ) - Nataraja G Class inheritance and moving Polygons Programming Software Development by powerdink … //front wheel hub page.setColor(Color.RED); page.fillPolygon(xBrake, yBrake, xBrake.length); //Brake light page.setColor…(Color.WHITE); page.fillPolygon(xLight, yLight, xLight.length); //Headlight page.setColor(Color… Re: Class inheritance and moving Polygons Programming Software Development by powerdink … //front wheel hub page.setColor(Color.RED); page.fillPolygon(xBrake, yBrake, xBrake.length); //Brake light page.setColor…(Color.WHITE); page.fillPolygon(xLight, yLight, xLight.length); //Headlight page.setColor(Color… Re: Class inheritance and moving Polygons Programming Software Development by powerdink …: int" That's if I change my [code]page.fillPolygon(xCar, yCar, xCar.length);[/code] to [code]page… Java Game Characteristics Programming Software Development by LSPUWILLC …) endCounter / (double) END_COUNT)); else offGraphics.setColor(snakeColor); offGraphics.fillPolygon(p); offGraphics.drawPolygon(p); offGraphics.drawLine(p.xpoints[p.npoints…), i * GRID_SIZE, j * GRID_SIZE); offGraphics.setColor(keyColor); offGraphics.fillPolygon(p); offGraphics.setColor(bgColor); offGraphics.drawPolygon(p); offGraphics.drawLine(p… Java Game Characteristics Programming Software Development by LSPUWILLC …) endCounter / (double) END_COUNT)); else offGraphics.setColor(snakeColor); offGraphics.fillPolygon(p); offGraphics.drawPolygon(p); offGraphics.drawLine(p.xpoints[p.npoints…), i * GRID_SIZE, j * GRID_SIZE); offGraphics.setColor(keyColor); offGraphics.fillPolygon(p); offGraphics.setColor(bgColor); offGraphics.drawPolygon(p); offGraphics.drawLine(p… Help in making Simple Screen Saver Programming Software Development by angellove40 … g.setColor(c1); g.fillPolygon(x1,y1,n1) ;//First Mountain g.fillPolygon(x2,y2,n2) ;//2nd Mountain g.fillPolygon(x3,y3,n3) ;//3rd… Java 2D Artistic Help. Programming Software Development by tnimblett … x[] = {450,600,750}; int y[] = {406,350,406}; g.fillPolygon(x,y,3); } public void sidebuilding1 (Graphics g) { g.setColor… x[] = {954,752,752}; int y[] = {439,410,439}; g.fillPolygon(x,y,3); } public void sidebuilding2 (Graphics g) { g.setColor… Kaleiodescope(sample) code need help Programming Software Development by jjt …+(int)(a[j]*radius), gMidy+(int)(b[j]*radius)); g.fillPolygon(nextPoly); phi = (i+1)*sectorAngle + Math.PI/2.0; //Reflect…(0,0,d.width,d.height); g.setColor(lens); g.fillPolygon(outline); } public boolean mouseEnter(Event evt, int x, int y… java applets Programming Software Development by bettybarnes … x[] = {98,300,501}; int y[] = {250,130,250}; g.fillPolygon(x,y,3); } public void roof2 (Graphics g) { g.setColor… x[] = {499,499,700}; int y[] = {320,249,320}; g.fillPolygon(x,y,3); } public void windows (Graphics g) { g.setColor… Turning into road - Traffic simulator Programming Software Development by shakssage …pgon.translate(posX, posY); g.setColor(cColor); g.fillPolygon(pgon); g.setColor(Color.black); g.drawPolygon(pgon);…pgon2.translate(232, 365); g.setColor(cColor); g.fillPolygon(pgon2); g.setColor(Color.black); g.drawPolygon(pgon2); … Cracks showing between polygons Programming Software Development by cms271828 …. // RenderingHints.VALUE_STROKE_NORMALIZE); 53. 54. g2.setColor(Color.yellow); 55. g2.fillPolygon(new int[]{point1.x, point2.x, point4.x, point3.x…, point2.y, point4.y, point3.y}, 4); 57. 58. g2.fillPolygon(new int[]{point3.x, point4.x, point6.x, point5.x… Why won't my menu pop up with the rest of my code? Programming Software Development by fengapapitt …[] aPoints = {170,200,185}; int[] bPoints = {370,370,320}; g.fillPolygon(aPoints,bPoints, 3); g.setColor(Color.black); g.fillRect(135…[] xPoints = {700,800,750}; int[] yPoints = {400,400,350}; g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.black); g.fillRect(730… Need to animate Snake game Programming Software Development by yuyuttiu … appley - 15 * applez}; g.setColor (Color.red); g.fillPolygon (j, k, 6); for (int i = 0 ; …230 + 40 * y [i] - 15 * z [i] }; g.fillPolygon (m, n, 6); } } else { gameOver (g); } g1.… Control Properties Programming Software Development by Patrickfrog1 … g.FillRectangle(brs, New Rectangle(0, 0, 10, 15)) g.FillPolygon(brs, New Point() {New Point(0, 15), New Point(5… g.FillRectangle(brs, New Rectangle(0, 0, 10, 15)) g.FillPolygon(brs, New Point() {New Point(0, 15), New Point(5… Abstract class Programming Software Development by amir4g …50); poly.addPoint(700, 200); poly.addPoint(500, 200); g.fillPolygon(poly); } } class Octagon { public Octagon(Graphics g1) { numSides…500); poly.addPoint(150, 500); poly.addPoint(100, 450); g.fillPolygon(poly); } } class Circle { public Circle(Graphics g1) { … Re: Triangle class Programming Software Development by alteran … used the following x and y and put them in fillpolygon and drawpolygon parameters instead of the two static int variables…() + (getX()/3))}; // int[] y = {(getY()+getY()), getY(), (getY()+getY())}; g.fillPolygon(x, y, N_POINTS); g.drawPolygon(x, y, N_POINTS); DrawHouse code help... Programming Software Development by ZEEPLE …, 500 ); polygon2.addPoint( 10, 700 ); polygon2.addPoint( 10, 700 ); g2d.fillPolygon( polygon2 ); //house image BufferedImage buffImage = new BufferedImage( 10, 10, BufferedImage…