About 52 results
Open links in new tab
  1. How does the Graphics Class in Java work? - Stack Overflow

    Aug 4, 2012 · To draw lines,shapes, characters, and images to the screen inside your applet. Most of the graphics operations in Java are methods defined in the Graphics class. You don’t have to create …

  2. graphics - Java: basic plotting, drawing a point/dot/pixel - Stack Overflow

    Feb 13, 2013 · Unfortunately java does not have any method for drawing a single point, instead you have to use drawLine with a same point for both start & end.

  3. How to Change Font Size in drawString Java - Stack Overflow

    Aug 15, 2013 · The answer below is mostly right. Start with the question slightly reworded. How do I change the font size of a g or g2d drawstring object? First create your g (or g2d) drawstring object …

  4. Set background color in java Graphics object - Stack Overflow

    Aug 19, 2015 · 6 Good day, Know that in Java Graphics object, we can user the setColor() method to set the object color. But this is only apply to the object border. Is it anyway to set color for the whole …

  5. How do I initialize a Graphics object in Java? - Stack Overflow

    Oct 18, 2015 · You dont initialize a Graphics object. You get the graphics object from a component via Component#getGraphics() method. In your particular case I think repaint() is all you need!!

  6. Introduction to Java Graphics Libraries - Stack Overflow

    Dec 8, 2015 · R Graph Gallery contains a large number of R graphics along with the code that used to create them (there's also the related R Movie Gallery). Definitely look at the Graphics view on CRAN, …

  7. java - How Do You Use Graphics 'g'? - Stack Overflow

    Sep 4, 2018 · 1 paintComponent(Graphics g) is a method inherited from JComponent (Note that paintComponent should have @Override anotation), it is part of the draw system of the GUI. It's …

  8. java - Java2D: Increase the line width - Stack Overflow

    May 15, 2010 · 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?

  9. graphics - How to create a Rectangle object in Java using g.fillRect ...

    How to create a Rectangle object in Java using g.fillRect method Asked 13 years, 6 months ago Modified 7 years, 3 months ago Viewed 117k times

  10. swing - Rotate a Java Graphics2D Rectangle? - Stack Overflow

    Sep 22, 2011 · public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; g2d.setColor(Color.WHITE); Rectangle rect2 = new Rectangle(100, 100, 20, 20); …