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

    Aug 4, 2012 · Recently, I have been trying to do some Java work with graphics. Now the Graphics class is abstract, meaning it itself cannot be instantiated but a subclass of it might be able to …

  2. 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?

  3. Best API for simple 2D graphics with Java - Stack Overflow

    Jan 28, 2016 · Java 2D (Graphics2D and friends) is indeed the best choice that I know of. Swing is actually implemented on top of Java 2D, so yes, if you want non-GUI-type graphics, Java 2D …

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

    Oct 18, 2015 · 0 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 …

  5. 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) …

  6. 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.

  7. How to draw in JPanel? (Swing/graphics Java) - Stack Overflow

    May 25, 2011 · For a very simple example of painting in Java, please see my reply in this thread: changing-jpanel-graphics-g-color-drawing-line. Also, don't futz with NetBeans-generated code …

  8. 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 …

  9. 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 …

  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, …