Top "Paintcomponent" questions

paintComponent (JComponent.

How to make star shape in Java?

I'm trying to make some shapes with Java. I created two rectangles with two different colors but I want to …

java swing paintcomponent shapes
Reason for "AWT-EventQueue-0" java.lang.NullPointerException error

I'm creating a video game in Java and I am trying to retrieve a list of coordinate points and draw …

java swing compiler-errors jpanel paintcomponent
Difference between paint, paintComponent and paintComponents in Swing

What is the actual difference between paint(), paintComponent() and paintComponents() in Java Swing? I tried to understand what explained in …

java swing paintcomponent
Bufferunderflowexception Java

I am writing values to a file. The values are written correct. In another application I can read the file …

java exception paintcomponent filechannel bufferunderflowexception
How to draw an image over another image?

I have a Java project that's about traffic network simulation in a random city, I've managed to figure out a …

java swing bufferedimage paintcomponent drawimage
Painting pixels images in Java

Which method is the best way to create a pixel image with java. Say, I want to create a pixel …

java swing pixel graphics2d paintcomponent
Java JPanel getGraphics()

Since Java only supports single inheritance, I desire to paint directly on an instance of a JPanel that is a …

java swing graphics jpanel paintcomponent
Path for image loading

I want to add an image to a frame but I am not able to understand where I should keep …

java image swing paintcomponent application-resource
Clicking on a drawn object

I've got a class called Shape which inherits from JPanel. A number of sub-classes in turn extend the Shape classes, …

java swing graphics jpanel paintcomponent
repaint() in Java doesn't "re-paint" immediately?

I have a code like that: // In MyPanel.java public void paintComponent(Graphics g) { super.paintComponent(g); // Draw something mypanel_…

java swing repaint paintcomponent