Change Coordinates directely in the graphe [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a Graphics2D and I draw on it some elements (circle for example) I want to be able to select every circle and change its place in my graphe (let's say change its coordinates in the Graphics2D)

Take a look at Oracle's tutorial: http://docs.oracle.com/javase/tutorial/2d/advanced/user.html
They describe how to recognize clicks within the Graphics2D. They also show how to move a single shape. You have to advance this approach a little bit in order to support multiple elements.

Related

What are the alternatives to rotation methods in java [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am asked to create a program as following..
"create random polygons, the point
when you press the mouse button is considered like a nail in the polygon. You can drag the polygon
with the mouse and place it somewhere on the wall. When you release the mouse button,
the polygon rotates around the nail in order to simulate the pulling of the gravity
You are not allowed to use methods from java (like AffineTransform). "
so far I managed to create random polygons, add a "nail", and drag the shapem but I can't seem to find a way to rotate it , can I -sort of- Transform it ?
One alternative to using an AffineTransform is to use geometry to calculate the new polygon.

Is there a way to change the icon of a Jslider? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to do my own program and what the basis of what I want is to use some sort of slider to take characters to different buildings. I essentially have a one long vertical road with my bus (which is what the slider will be). I know the general icon for a JSlider is a small pentagon that can be dragged to different values. I was just wondering, is there a way to change that pentagon icon into something of my choice?
You'll need to extend the BasicSliderUI and override paintThumb() to render the desired Shape. This example renders a triangle using drawLine().

How to convert Grayscale image to Color in Java? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Could you point me in the right direction to find a tutorial on how to convert a grayscale image to it's original colors? Is this even possible?
I've tried using BufferedImage and applying a function to the RGB values by bitshifting them 8 bits to the left and isolating the reds, but, of course, there are no reds that are found, as it is grayscale.
I'd really appreciate a push in the right direction!
"Is this even possible?" -- No, not a prayer's chance in Hades. Once you have a grayscale image, all color information is gone.

ON/OFF flip button in Swing [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I wish to create a button exactly same as this (from iOS5).
You will have two images, for ON and for OFF.
Whenever you click the button, you will switch images with button.setImage(..).
Swing constraints:
Button will still be rectangular, even though the image is oval
Animation possible, but quite hard AFAIK. From the way you asked your question, I think it will take you a while to study swing more
In swing, there is JToggleButton which can have two status. However, if you want the button of the same shape and the same visual effect, you should implement it.

How to create a suggestion box [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I was developing an java swing application to add view and modify the list of medicines.While adding the medicines it should show the list from the database(like google search box).For example if we press "p" it should show 'paracetamol' from the database.
You should implement a change listener on the text input box, when the text is changed, run a query to the database with the contents of the input box.

Categories

Resources