graphics2d Questions

3

Solved

What's the easiest way in Java SE 7 to obtain an instance just to plot a few points for debugging? Desktop environment.
Empiric asked 13/5, 2013 at 23:18

3

Solved

Typically, when I create a class, for example Customer, I give it some data fields, i.e. public int IdNumber; and some methods, i.e. public String getName(){...}. But that's pretty much it. I can't...
Overissue asked 8/5, 2013 at 12:29

4

Solved

I have searched everywhere and I just cant find the answer. How do I rotate a Rectangle in java? Here is some of my code: package net.chrypthic.Space; import javax.swing.*; import java.awt.*; im...
Heintz asked 22/9, 2011 at 15:50

4

I am working on a pie chart with 4 different elements. I can get the elements to appear in the JFrame but I cannot complete the pie chart circle. These are the elements: public static class PieCh...
Insincerity asked 13/4, 2013 at 14:15

1

Solved

I'm currently working on a game in Java and am trying to create a background without using any image files. The image consists of a square split into 4 triangles, each of which is a different color...
Hypno asked 5/4, 2013 at 2:46

1

Solved

I am trying to make a piece of a JPanel transparent, but I cannot quite get it to work. Is it possible to do this? import java.awt.*; import javax.swing.*; public class ClearPanel extends JPanel{...
Glantz asked 9/3, 2013 at 10:20

1

I want to represent a timer by having a filled circle which is fully drawn over the course of the timer by segment. I.e. If the circle is filled in every 1 second for a timer of 4 seconds the first...
Boehmite asked 1/3, 2013 at 21:36

2

Solved

Here's the function which draws a shape at the given coordinates: public void drawTank(int x,int y){ int h = 50; int w = 50; graphic.setColor(Color.darkGray); graphic.drawRect(x, y, h, w); ...
Strongminded asked 14/2, 2013 at 21:35

1

Solved

Im using PrinterJob object in order to print my Bufferedimage, I have a BufferedImage which I proccess and send it to Printer job with Paper Format etc, and I cant make it fittable to my card print...
Admittedly asked 6/2, 2013 at 9:21

2

Solved

The vertical position of text rendered in Helvetica and the size of its content area differ between Firefox and Chrome for Mac. For example, in Chrome, the descenders are clipped if the line-height...
Deadlock asked 28/1, 2013 at 23:57

2

Solved

I would like to rotate a rectangle around its center point and it should remain in the place that it is supposed be drawn and rotate in that space this is my code: AffineTransform transform = new...
Zetes asked 10/1, 2012 at 17:33

2

I have searched high and low for this answer and have come up blank. I have a requirement to print the contents of a JTextPane with a footer that says "Page <n> of <m> pages". It appea...
Penley asked 9/2, 2012 at 15:9

1

Solved

Background: I need to be able to create imagery in "disabled" look. The commonly suggested approach is to convert images to grayscale and show the grayscaled image. The drawback is that it only wor...
Gerius asked 29/11, 2012 at 16:5

1

Solved

I'm kind of new to java. I want to make a game. After a lot of research, I can't understand how bufferstrategy works.. I know the basics.. it creates an off-screen image that you can later put into...
Lustre asked 27/11, 2012 at 17:43

2

Solved

I am making a simple animation in Java and I am trying to make it as smooth as possible. I use only *.Double inner classes of each Shape object and I set antialiasing in the Graphics2D objects on....
Windfall asked 24/11, 2012 at 10:57

3

I have written a particle system applet; currently I am creating, and drawing each particle separately. (Here is the code) BufferedImage backbuffer; Graphics2D g2d; public void init(){ backbuffe...
Mckay asked 22/11, 2012 at 23:34

3

Solved

I have a JFrame in my Java application that contains a JPanel where I have some drawing objects created at run-time. The problem is while scrolling the JFrame for large figures the scrolling slows ...
Luggage asked 4/7, 2012 at 13:40

2

Solved

I'm trying to build a simple paint tool. The mouseDrag events creates a new ellipse and causes my JPanel to repaint(). This works fine so far. However, if I press any button (or any other UI compo...
Togs asked 13/11, 2012 at 9:58

3

Solved

I want to find all grid tiles that touch or contain parts of a given finite line segment. The grid is a 2d regular grid, thus I can deduce any tile's center from a tile position (row,colum) and vic...
Lontson asked 12/11, 2012 at 21:55

1

Solved

So I'm creating a side scroller and I'm trying to draw an image at the point of another image. I have my background image which is 5000 x 500 and lets say I want to draw an image that's 25x25 at 5...
Doe asked 11/11, 2012 at 3:25

1

Solved

I'm honestly not sure if the title fits the question completely, but here it is anyway. I'm making a simple game in java where alien spaceships fall down from the top of the screen and if you don't...
Dak asked 21/8, 2012 at 1:0

4

Solved

I am using Java's Graphics2D to draw on a component using AffineTransform's to manipulate my drawing. Graphics2D offers an method transform for this, which takes an AffineTransform. Sometimes I ne...
Schaffer asked 9/7, 2012 at 20:23

2

Hi i want to convert panel which contains components like label and buttons to image file. I have done the following code. The image was saved. but the content of the panel not visible or saved. C...
Pianoforte asked 30/6, 2012 at 9:14

4

Solved

How to use the repaint() method when a button is pressed and Graphics p has to re-paint everything from scratch? Thanks. import javax.swing.Box; import javax.swing.JButton; import javax.swing....
Cosenza asked 20/6, 2012 at 23:28

4

I'm able to rotate an image that has been added to a JLabel. The only problem is that if the height and width are not equal, the rotated image will no longer appear at the JLabel's origin (0,0). H...
Hooves asked 22/4, 2010 at 2:42

© 2022 - 2024 — McMap. All rights reserved.