Questions tagged [paint]

The act of displaying a GUI component on a screen output device

Painting is the act of displaying a GUI component on a screen output device, and is responsible for visually representing the component object to the user. For example, displaying a Button object should paint a 'button' shape on the screen, with the text or icon that relates to the button.

2808 questions
0
votes
1 answer

What is wrong with my code. I am unable to draw on the screen

I have checked my code several times and don't know where is it going wrong. i am trying to build a drawing app and after doing all this code I am unable to get any output. Not able to draw on the canvas. please help me get rid of this issue. This…
Amandeep Singh
  • 138
  • 2
  • 4
0
votes
2 answers

How would I go about making my paint for my JFrame automatically update?

Currently, I have a JFrame that contains a JPanel. The JPanel is the paint for my program. Paint meaning all of my Graphics g.drawString things. Right now, it only updates the display whenever the user interacts with the JFrame, but I want it to…
Dylan Wheeler
  • 6,928
  • 14
  • 56
  • 80
0
votes
0 answers

How to draw a list of images with circular border in dart canvas?

I need to draw a list of images with canvas, and I need that each image has a circular border: expected: but what I implemented is: my code is: for (int i = 0; i < participants.length; i++) { Completer completer =…
Parisa Baastani
  • 1,713
  • 14
  • 31
0
votes
0 answers

vb.net - paint on every white pixel

I have a lot of pictures (about 10.000) and would need to paint with Pink on every pixel that is white. I found multiple threads on getting the color of a pixel, but they require me to go over every pixel of every image and verify if it is white. On…
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97
0
votes
0 answers

seperat shape painted by 0 and 1 array

I have text file contain array of 0s and 1s. Its width is 64 and I want to convert it to 32 pixel but keep shape painted by it is visible. I tried to take one and delete one. But that makes shape not visible. I tried to sum every two pixels but code…
0
votes
0 answers

flutter) I want to know how to drag & draw shapes through Custom Paint

I'm making a whiteboard app. I learned how to draw lines using GestureDetector() and CustomPaint(). Now I'm going to draw the shapes, but I don't know how to draw the location and size of the shape by touching and dragging them after selecting the…
Kevin Yang
  • 629
  • 1
  • 5
  • 19
0
votes
1 answer

Repainting in while loop

I know that this question has been asked many times in a similar way on this platform. I've already spent a few hours trying the answers on my code (Threats and much more), but nothing has worked for me so far. So I'll ask the question here again…
Earny
  • 1
  • 1
0
votes
1 answer

Drawing with functions on JFrame or JPanel java

I wanted to know if it is possible to use/make a function in another Class to draw an image/oval and then call it in the paint public void in our main Class. If I have public class Trydraw{ public void drawrcircle(Graphics g){ …
0
votes
1 answer

How to plot many spheres and points with Python

I have a file which haves coordinates x,y,z and radius r of many spheres. I want to plot with python theses spheres and the points (x,y,z). It doesn't have to be in 3D, it is good if it is in 2D (ignore the coordinate z, for example). I don't even…
elenafer
  • 55
  • 5
0
votes
0 answers

How to bounce a circle drawn with JFrame graphics context on JFrame click?

I have managed to draw a circle on a JFrame object I have in my Netbeans IDE. How can I make the circle bounce when I click my JFrame. I need help making the circle move down and as soon as it touches the lower border of my JFrame it bounces back up…
0
votes
1 answer

how to update panel with repaint()?

I have a panel-class: public class MyPanel extends JPanel { Color myColor = Color.BLUE; String string = "Hello"; public void update(String newString) { myColor = Color.GREEN; string = newString; repaint(); …
KerryKilian
  • 95
  • 11
0
votes
1 answer

repaint() not updating panel?

I have a class (not public, so you probably do not know the class) which is drawing a picture with picture.draw(g2). With picture.changeToDry() I can change the picture. It works fine, when I call the picture and change it in implemented…
KerryKilian
  • 95
  • 11
0
votes
2 answers

Issues my method to get a 2D circle to move in a circle

OBS! Changed as part of the question has been answered. My math has been fixed due to your help and input, the same with StackOverflowError but I still can get my head around how to make the circle move from one x,y point to another. Currently I…
Narj
  • 39
  • 5
0
votes
1 answer

How to achieve non-destructive painting in Java?

I want to plot many sinusoids with different frequencies on a panel, but because painting is destructive, I cannot achieve this. I can only see the last sinusoid plotted. In the code, the generateSinus() method is called only three times, but it…
Ozgur
  • 15
  • 2
0
votes
1 answer

Java -Repaint() not working when i want to call it

I wonder why the repiant() method is not working as intended. My Code: import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import…
Fynn
  • 25
  • 2