graphics2d Questions

1

Solved

I am trying to draw a line using the Graphics 2D but then the line appears over all the other components in the JFrame thus making them invisible. How do I correct this problem? Here's the code :...
Geraint asked 26/5, 2012 at 14:58

1

Solved

I am trying to print a JTable and the print() method works great till I come to this scenario. Lets say I want to print before, in the first page only (not header) the text "Report" and on the end ...
Positive asked 20/4, 2012 at 17:27

1

Solved

Having a bit of a drawing complication you would call it. My math is a bit rusty when it comes to Matrices and drawing rotations on shapes. Here is a bit of code: private void Form1_Paint(object s...
Gathering asked 18/4, 2012 at 13:13

1

Solved

Can anyone suggest some good way to generate Graphics2D object form SVG data? I've seen Apache Batic lib, but it seams that they use some JSVGCanvas that gets the URI etc… And I want a Graph...
Slurp asked 30/3, 2012 at 8:48

2

Solved

I am just trying to rotate a JPG file by 90 degrees. However my code outputs image (BufferedImage) that is completely black. Here's the way to reproduce: (Download 3.jpg here) private static Buff...
Nausea asked 17/3, 2012 at 10:13

1

Solved

I'm using g.drawString(str, x, y) to draw a String with a Graphics2D object g. The current font of g does not cover all the characters of str (I have e.g. Chinese chars in there). On Mac OS X, a fa...
Branks asked 28/2, 2012 at 12:52

2

I need to: 1.) move the origin and also rotate the coordinate plane so that x-values progress rightward and y-values progress upward from the new origin(which needs to be the bottom left corner of...
Lynnet asked 21/2, 2012 at 3:54

1

Solved

Seems like as not possible to fix Graphics2D lack in code, there I must to set fix size for animations, otherwise some Start outside Rectangle 490 x 490 freeze or shaking on the screen my SSCCE ...
Rabblerousing asked 23/12, 2011 at 10:32

1

Solved

Thanks ahead of time for the help Description: The program draws, displays, and saves an image. It works as following: the object itself extends Frame. In the constructor, the object creates a Bu...
Oration asked 7/12, 2011 at 5:53

3

Solved

I'm writing a simple program to test out basic GUI. The program prints a letter in the middle of the screen and allows the user to move it with the arrow keys. Everything works fine, but when I try...
Southwestwardly asked 1/12, 2011 at 3:38

1

Solved

Is there a way to make a JLabel's text stretch to 100% height? I need the text to update when the component's size changes as well. I saw some solution that could work; It involved calculating and...
Flounce asked 26/11, 2011 at 21:48

1

Solved

I want to draw a PARTIALLY transparent image on top of another (Making shadows over things). I am currently using java's Graphics2D class to render, I've been told to set the composite to AlphaComp...
Ricker asked 25/11, 2011 at 17:43

7

Solved

I'm trying to create some special component for a specific purpose, on that component I need to draw a HTML string, here's a sample code: public class MyComponent extends JComponent{ public MyCo...
Babar asked 15/10, 2011 at 0:42

3

I'm working with graphcis2d in Java and am currently using this to draw text into a bufferedImage Font font1 = new Font("Arial", Font.PLAIN, 120); g2d.setFont(font1); FontMetrics fm1 = g2d.getFont...
Dotterel asked 19/9, 2011 at 2:5

2

Solved

I have Line2D and Arc2D objects laid out on my JPanel by Graphics2D drawing. You can have a look a part of it on this question " How to make pixel perfect Line2D in - Graphics2D ". Now what I want ...
Villareal asked 8/9, 2011 at 4:0

1

Solved

G'day, I have JPanel with some Line2D objects on it. Issue is when I draw this line it doesn't appear as I want them to. Lines are not smooth, It's hard to explain in word so I am posting an Image,...
Jolty asked 7/9, 2011 at 4:55

4

Solved

I've written an app that custom draws everything inside paint() based on fixed pixel positions. Then I disabled resize of the frame so its always visible. However, now I would like to be able to r...
Prowel asked 19/8, 2011 at 15:13

1

Solved

So, I'm creating a 2d top-down game in Java. I'm following instructions from Java 2D: Hardware Accelerating - Part 2 - Buffer Strategies to take advantage of hardware acceleration. Basically, wha...

3

Which method is the best way to create a pixel image with java. Say, I want to create a pixel image with the dimensions 200x200 which are 40.000 pixels in total. How can I create a pixel from a ran...
Betancourt asked 13/8, 2011 at 0:39

4

Solved

I've been toying around in Android and attempting to port over a Java app. Below are some questions regarding to issues I've run into and would like some guidance on. It is a rather large questio...
Sarraceniaceous asked 25/7, 2011 at 21:2

2

Solved

I was experimenting with Graphics2D in Java. But as usual, I am stuck. :P The problem is: Suppose i have this code, Graphics2D g=(Graphics2D)(this.getGraphics()); //Inside a JFrame g.rotate(Math.P...
Abie asked 13/7, 2011 at 15:41

2

Solved

I am new to Java and have been trying to make some simple games in it with lots of images on screen. Since then I have been using the 'Graphics' class to draw these images, strings and shapes, but ...
Arguseyed asked 10/6, 2011 at 14:56

2

Solved

Im working on a paint application written in java and running into a few (more) problems. I have a gui and a working program(kinda), my only problem is that the lines and graphics that the user dra...
Mcintire asked 26/5, 2011 at 2:10

3

Solved

Here is the original image: http://rank.my/public/images/uploaded/orig-4193395691714613396.png And here it is scaled down to 300x225: http://rank.my/public/images/uploaded/norm-419339569171461339...
Glowing asked 11/2, 2011 at 2:13

1

Solved

This is the code I have, it actually works, not perfectly but it does, the problem is that the resized thumbnails are not pasting on the white Drawn rectangle, breaking the images aspect ratio, her...
Sieve asked 30/4, 2010 at 13:44

© 2022 - 2024 — McMap. All rights reserved.