java Programming Glossary: g2d.setpaint
Program not accessing method paintComponent() of extended JPanel class http://stackoverflow.com/questions/12226198/program-not-accessing-method-paintcomponent-of-extended-jpanel-class w h Graphics2D g2d image.createGraphics g2d.setPaint new Color 0x00f0f0f0 g2d.fillRect 0 0 w h icon.paintIcon null..
How can we Draw a lines between 2 panels in swing http://stackoverflow.com/questions/12382184/how-can-we-draw-a-lines-between-2-panels-in-swing RenderingHints.VALUE_ANTIALIAS_ON g2d.setPaint Color.BLACK for JComponent c1 linked.keySet Point p1 getRectCenter..
How to print strings with line breaks in java http://stackoverflow.com/questions/12794382/how-to-print-strings-with-line-breaks-in-java g g2d.translate format.getImageableX format.getImageableY g2d.setPaint Color.black Point2D.Float pen new Point2D.Float AttributedCharacterIterator..
Swing: resizing a JFrame like Frames in Linux e.g http://stackoverflow.com/questions/13065032/swing-resizing-a-jframe-like-frames-in-linux-e-g new Color 0 0 0 0 true Graphics2D g2d Graphics2D g g2d.setPaint p g2d.fillRect 0 0 getWidth getHeight @Override public Dimension..
how can you make a progress bar without using JProgressBar? http://stackoverflow.com/questions/14036173/how-can-you-make-a-progress-bar-without-using-jprogressbar 1 1 progress h 1 A gradient over the progress fill g2d.setPaint gradient g2d.setComposite transparent g2d.fillRect 1 1 w 1 h..
SwingWorker, Thread.sleep(), or javax.swing.timer? I need to “insert a pause” http://stackoverflow.com/questions/16292498/swingworker-thread-sleep-or-javax-swing-timer-i-need-to-insert-a-pause new float 0f 1f new Color Color.WHITE Color.GRAY g2d.setPaint lgp g2d.fill new Rectangle 0 0 getWidth getHeight if flipped..
Printing reciepts with thermal printer in java http://stackoverflow.com/questions/17505070/printing-reciepts-with-thermal-printer-in-java Graphics2D g2d Graphics2D graphics.create g2d.setPaint Color.black g2d.setFont new Font Arial Font.BOLD 10 g2d.translate..
Creating a dot/pixel outside of a JFrame, any location on the screen http://stackoverflow.com/questions/18244769/creating-a-dot-pixel-outside-of-a-jframe-any-location-on-the-screen colors MultipleGradientPaint.CycleMethod.NO_CYCLE g2d.setPaint p g2d.fillRect 0 0 getWidth getHeight f.setContentPane..
Re-paint problem on translucent frame/panel/component http://stackoverflow.com/questions/2163544/re-paint-problem-on-translucent-frame-panel-component g2d.fillRect 0 0 w h g2d.setComposite AlphaComposite.Src g2d.setPaint g2d.getBackground g2d.fillRect 0 0 w h renderTime g2d int w2..
Aligning messageformat on printing a JTable http://stackoverflow.com/questions/2311508/aligning-messageformat-on-printing-a-jtable g2d.getFontMetrics .getHeight System.out.println index r g2d.setPaint Color.gray g2d.drawString s r.x r.width dw r.y r.height dh return..
Using Graphics2D to overlay text on a BufferedImage and return a BufferedImage http://stackoverflow.com/questions/2658554/using-graphics2d-to-overlay-text-on-a-bufferedimage-and-return-a-bufferedimage g2d img.createGraphics g2d.drawImage old 0 0 null g2d.setPaint Color.red g2d.setFont new Font Serif Font.BOLD 20 String s Hello..
How to rotate an image gradually in Swing? http://stackoverflow.com/questions/3405799/how-to-rotate-an-image-gradually-in-swing RenderingHints.VALUE_ANTIALIAS_ON g2d.setPaint Color.getHSBColor r.nextFloat 1 1 g2d.setStroke new BasicStroke..
Change JTree node icons according to the depth level http://stackoverflow.com/questions/4640818/change-jtree-node-icons-according-to-the-depth-level RenderingHints.VALUE_ANTIALIAS_ON g2d.setPaint color if expanded g2d.fillOval x SIZE 4 y SIZE 2 SIZE else..
When does a JPanel paint (or repaint) its child components? http://stackoverflow.com/questions/5169647/when-does-a-jpanel-paint-or-repaint-its-child-components int h this.getHeight Graphics2D g2d Graphics2D g g2d.setPaint new GradientPaint 0 0 Color.blue w h Color.red g2d.fillRect..
Rotating a shape vertically around the x-axis http://stackoverflow.com/questions/5593066/rotating-a-shape-vertically-around-the-x-axis w 2 h 2 at.scale scale scale at.translate p3x 5 10 p3y 5 g2d.setPaint Color.blue g2d.fill at.createTransformedShape p3 public void..
How do I set hard limit on a JComponent when setMaximumSize() and setPrefferedSize() don't work? http://stackoverflow.com/questions/8088885/how-do-i-set-hard-limit-on-a-jcomponent-when-setmaximumsize-and-setprefferedsi Graphics2D g2d bi.createGraphics g2d.setPaint Color.lightGray g2d.fillRect 0 0 w h g2d.setColor Color.black..
|