Hi there, my name is Daniel and I'm from Spain.
I am developing a small program which cuts images by the color.
That's will be easiest to explain using an example image. I have got this image:
http://dl.dropbox.com/u/944667/Ejemplo1.png
And I want to create a new image just with the purple form, without the black frame.
Does anyone ...
Hello. I have written program for drawing pythagoras tree fractal. Can anybody see any way of improving it ? Now it is 89 LOC.
import java.awt.*;
import java.util.Scanner;
import javax.swing.*;
public class Main extends JFrame {;
public Main(int n) {
setSize(900, 900);
setTitle("Pythagoras tree");
add(new D...
I am having the below code.
public VizCanvas(){
{
this.setBackground(Color.black);
this.setSize(400,400);
}
}
It worked fine and displays the panel in black background. But when I implement the paint method, which does nothing, the color changes to default color i.e gray.
I tried to set graphics.setColor() but...
Hi,
I am developing an application using Java2d. The weird thing I noticed is, the origin is at the top left corner and positive x goes right and positive y increases down.
Is there a way to move the origin bottom left?
Thank you.
...
iam using the swt java library and iam having a problem.
the gc draw arc method takes the following arguments
GC.drawArc(int x, int y, int width, int height, int startAngle, int endAngle);
but i want to be able to draw the arc using 3 arguments : the source ,destination and
control points.
is there any formula to convert between tho...
I have a JPanel which has a line, circle etc..Now when I click on the line, will the event get reported as a line event or a general jframe event. I need to be able to move the line, if the user clicks on the line and moves it. Is this possible in Java2d.
Thank you.
...
First problem: You have 400 pixels width to go on, and need to fit some text within that constraint as large as possible (thus, the text shall use that amount of space).
Throw in a new constraint: If the text is just "A", then it shall not zoom this above 100 pixels height (or some specific font size).
Then, a final situation: Linebrea...
Hi,
I have a image in Java2d and I would like user to give an option to select any rectangle portion of the image by left clicking and dragging the mouse.(similar to mspaint). How is this actually done?
Thank you.
...
Hi,
I want to increase the Line2D width. I could not find any method to do that. Do I need to actually make a small rectangle for this purpose?
Thank you.
...
Hi,
I am having multiple points in a plane and some hundreds of lines pass through those points. Some points can have more lines passing through them than other points. I want to show some kind of more gradient or brightness associated with lines crowded together. Is this possible to do in java2d.
Please refer to this : http://ft.ornl....
I'm trying to print Invoices in a Java Swing applications. I do that by extending Printable and implement the method public int print(Graphics g, PageFormat pf, int page).
I would like to draw strings in columns, and when the string is to long I want to clip it and let it end with "...". How can I measure the string and clip it at the r...
I have a longer text saved in a String. I would like to print the text in two columns on a single page. How can I do this using Java Swing?
I don't understand how I can wrap the text when it's time to use a new line. I have read Lesson: Printing in the Java tutorial, but I haven't found any useful methods for working with text or String...
I recently updated my computer to a more powerful one, with a quad-core hyperthreading processor (i7), thus plenty of real concurrency available. Now I'm occasionally getting the following error when quitting (System.exit(0)) an application (with a Swing GUI) that I'm developing:
Exception while removing reference: java.lang.Interrupted...
OK so, I am making an applet that paints 32x32 square tiles (to make a map) and my problem is that they are going diagonally when I want them to go 8 by 8 (hence the way the array is shaped 8 by 8). So... how do I fix this?
Thanks. Anyway, since the code bbcode is being a butthead... here is the pastebin URL :-)
http://www.danflow.past...
I'm trying to draw a polygon with a stroke of 1 pixel. Because the entire polygon is scaled by 100, I set the line width to 0.01. For some reason though, the polygon gets drawn with an on-screen line width of what looks to be 100 pixels instead of 1.
I'm using GeneralPath as the polygon shape. Thin lines do get drawn if I use the same a...
I have a java2d image defined in user space (mm) to print an identity card. The transformation to pixels is by using an AffineTransform for the required DPI (Screen or print).
I want to wrap text across several lines but the the TextLayout does not respect user space co-ordinates. I was using the following to write wrapped text to a re...
We are using Java2D to resize photos uploaded to our website, but we run into an issue (a seemingly old one, cf.: http://forums.sun.com/thread.jspa?threadID=5425569) - a few particular JPEGs raise a CMMException when we try to ImageIO.read() an InputStream containing their binary data:
java.awt.color.CMMException: Invalid image format
...
I'm trying to render my JTable cells with a subclassed JPanel and the cells should appear as coloured rectangles with a circle drawn on them. When the table displays initially everything looks OK but then when a dialog or something is displayed over the cells when it is removed the cells that have been covered do not rendered properly an...
I've added a JPanel to my Netbeans generated GUI, and add a JPanel BoxThing that overrides paintComponent and draws a small red box, but it doesn't display, paintComponent never even gets invoked. If I instantiate my own JFrame and put a JPanel containing a BoxThing in it, it works fine.
I've seen this question asked a few other times o...
In my project,I will get the coordinates of some points from an XML file,and create some visual components using this information ? I am planning to give these components to a Java swing frame or panel. However,The users are supposed to click on the figure(which I will construct using Graphics 2d libraries) and select two points and give...