¡@

Home 

java Programming Glossary: paint

Show an animated BG in Swing

http://stackoverflow.com/questions/10836832/show-an-animated-bg-in-swing

JEditorPane and be seen to cycle. But to load an image to paint as the background of a container I would typically use either.. The Component.imageUpdate method should invoke repaint as needed. Edit As noted in the comments the call to prepareImage.. example is included below. The key is that the overridden paintComponent method invokes Graphics.drawImage which provides the..

Java: maintaining aspect ratio of JPanel background image

http://stackoverflow.com/questions/11959758/java-maintaining-aspect-ratio-of-jpanel-background-image

ratio of JPanel background image I have a JPanel with a painted background image and a layout manager holding other smaller.. not will this pose a problem I'll post my code below for painting the image If I lack any information please let me know. public.. generated catch block e.printStackTrace protected void paintComponent Graphics g paint background image super.paintComponent..

Java Bouncing Ball

http://stackoverflow.com/questions/13022754/java-bouncing-ball

delay 40 x 1 y 1 vx xvelocity vy yvelocity protected void paintComponent Graphics g super.paintComponent g Graphics2D g2 Graphics2D.. yvelocity protected void paintComponent Graphics g super.paintComponent g Graphics2D g2 Graphics2D g g2.setRenderingHint RenderingHints.KEY_ANTIALIASING.. e System.out.println interrupted move repaint public void move if x vx 0 x diameter vx getWidth vx 1 if y..

Threads with Key Bindings

http://stackoverflow.com/questions/13999506/threads-with-key-bindings

e System.out.println You Interrupted the game canvas.repaint Here's the paintComponent method of the canvas object public.. You Interrupted the game canvas.repaint Here's the paintComponent method of the canvas object public void paintComponent.. the paintComponent method of the canvas object public void paintComponent Graphics g super.paintComponent g paddleOne.paint g..

What is a stack overflow error?

http://stackoverflow.com/questions/214741/what-is-a-stack-overflow-error

indirect recursion. For example your app may be handling paint messages and whilst processing them it may call a function that.. may call a function that causes the system to send another paint message. Here you've not explicitly called yourself but the..

Re-paint problem on translucent frame/panel/component

http://stackoverflow.com/questions/2163544/re-paint-problem-on-translucent-frame-panel-component

paint problem on translucent frame panel component I'm trying to.. its text every second.... However the component is not repainting well. How can I solve this problem I've found the these articles.. run label.setText Hola i 0 1000 java swing osx awt paint share improve this question I've had some luck extending..

GUI not working after rewriting to MVC

http://stackoverflow.com/questions/3066590/gui-not-working-after-rewriting-to-mvc

and when I click on empty Pin that should be updated and repainted with new color noting happens. Can anybody see any problems.. Can anybody see any problems here I've tried placing repaint in different places but it simply does not work at all Main.. int curPin 0 int turn 1 Random generator new Random int repaintPin boolean pinsRepaint false int pinsToRepaint boolean isUpdate..

Java - Transparent JScrollPane

http://stackoverflow.com/questions/3517722/java-transparent-jscrollpane

used to optimize drawing true The component agrees to paint all of the bits contained within its rectangular bounds. false.. bounds. false The component makes no guarantees about painting all the bits within its rectangular bounds. Transparency.. new Dimension 6 TILE 6 TILE @Override public void paintComponent Graphics g super.paintComponent g g.setColor Color.blue..

Java, how to draw constantly changing graphics

http://stackoverflow.com/questions/3742731/java-how-to-draw-constantly-changing-graphics

Exception e update false public void update Graphics g paint g boolean isdone true public void paint Graphics g if isdone.. update Graphics g paint g boolean isdone true public void paint Graphics g if isdone isdone false int step 40 Point p MouseInfo.getPointerInfo.. what changed updates the model then requests the view to repaint. This approach updates instantly to the human eye. 289 screen..

Swing: link toggle buttons together with a button group, along with corresponding menu items

http://stackoverflow.com/questions/4038605/swing-link-toggle-buttons-together-with-a-button-group-along-with-correspondin

menu items For a school project I need to make a simple paint application that can draw lines ovals and rectangles. The assignment..

Draw a line in a JPanel with button click in Java

http://stackoverflow.com/questions/5797862/draw-a-line-in-a-jpanel-with-button-click-in-java

label_4 This is the code to draw a line public void paint Graphics graphics graphics.drawLine 10 20 300 310 So how to.. mouseHandler @Override protected void paintComponent Graphics g super.paintComponent g Graphics2D g2d Graphics2D.. @Override protected void paintComponent Graphics g super.paintComponent g Graphics2D g2d Graphics2D g g2d.setColor Color.blue..

Swing: Obtain Image of JFrame

http://stackoverflow.com/questions/5853879/swing-obtain-image-of-jframe

render themselves as images into a double buffer prior to painting themselves onto the screen. Is there a way to obtain these.. BufferedImage.TYPE_INT_RGB call the Component's paint method using the Graphics object of the image. component.paint.. method using the Graphics object of the image. component.paint image.getGraphics return image public static void main String..

Passing current Date

http://stackoverflow.com/questions/8614972/passing-current-date

tbl viewport tableViewPort.getViewport RepaintManager.setCurrentManager new RepaintManager @Override public.. RepaintManager.setCurrentManager new RepaintManager @Override public void addDirtyRegion JComponent c int.. setPreferredSize this.getPreferredSize paintBackGround new Color 250 250 150 public void add Star star ..

Drawing a Component to BufferedImage causes display corruption

http://stackoverflow.com/questions/11739989/drawing-a-component-to-bufferedimage-causes-display-corruption

Graphics2D g2d img.createGraphics Paint JScrollPane view to off screen image and then scale. It is this..

Drawing a rectangle that won't disappear in next paint

http://stackoverflow.com/questions/12683533/drawing-a-rectangle-that-wont-disappear-in-next-paint

i already created and draw they all in every call of Paint . But there is a lot of rectangles and it slows the computer... multiple panes as rectangles make the MyPanel transparent. Paint's are stateless. There is no connection between the last paint..

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

only @Override protected void paintComponent Graphics g Paint p new GradientPaint 0.0f 0.0f new Color 0 0 0 0 0.0f getHeight.. void paintComponent Graphics g Paint p new GradientPaint 0.0f 0.0f new Color 0 0 0 0 0.0f getHeight new Color 0 0 0 0.. Color 0 0 0 0 true Graphics2D g2d Graphics2D g g2d.setPaint p g2d.fillRect 0 0 getWidth getHeight @Override public Dimension..

Border with rounded corners & transparency

http://stackoverflow.com/questions/15025092/border-with-rounded-corners-transparency

awt border transparency share improve this question Paint the BG color of the parent everywhere outside the clip of the.. area.add new Area pointer g2.setRenderingHints hints Paint the BG color of the parent everywhere outside the clip of the..

Problems with Java's Paint method, ridiculous refresh velocity

http://stackoverflow.com/questions/15897947/problems-with-javas-paint-method-ridiculous-refresh-velocity

with Java's Paint method ridiculous refresh velocity I'm developing a very simple.. are others methods or ways best than it Video of Movement Paint method at main Panel @Override public void paint Graphics g..

Android - drawing path as overlay on MapView

http://stackoverflow.com/questions/3036139/android-drawing-path-as-overlay-on-mapview

i 1 to p.moveTo from.x from.y p.lineTo to.x to.y Paint mPaint new Paint mPaint.setStyle Style.FILL mPaint.setColor.. i 1 to p.moveTo from.x from.y p.lineTo to.x to.y Paint mPaint new Paint mPaint.setStyle Style.FILL mPaint.setColor 0xFFFF0000.. p.moveTo from.x from.y p.lineTo to.x to.y Paint mPaint new Paint mPaint.setStyle Style.FILL mPaint.setColor 0xFFFF0000 mPaint.setAntiAlias..

Export PDF pages to a series of images in Java

http://stackoverflow.com/questions/550129/export-pdf-pages-to-a-series-of-images-in-java

image to buffered image Graphics g bimage.createGraphics Paint the image onto the buffered image g.drawImage image 0 0 null..

How do I draw an arrowhead (in Android)?

http://stackoverflow.com/questions/6713757/how-do-i-draw-an-arrowhead-in-android

context @Override protected void onDraw Canvas canvas Paint Background Paint background new Paint background.setColor getResources.. protected void onDraw Canvas canvas Paint Background Paint background new Paint background.setColor getResources .getColor.. onDraw Canvas canvas Paint Background Paint background new Paint background.setColor getResources .getColor R.color.background..

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

frame similar to one found in something like Photoshop or Paint Shop Pro and I'm running into problems. Right now I have a JFrame.. Graphics2D g2d bi.createGraphics g2d.setPaint Color.lightGray g2d.fillRect 0 0 w h g2d.setColor Color.black..

Android How to draw a smooth line following your finger

http://stackoverflow.com/questions/8287949/android-how-to-draw-a-smooth-line-following-your-finger

sure you change your paint from fill to stroke paint new Paint Paint.ANTI_ALIAS_FLAG paint.setStyle Paint.Style.STROKE paint.setStrokeWidth.. you change your paint from fill to stroke paint new Paint Paint.ANTI_ALIAS_FLAG paint.setStyle Paint.Style.STROKE paint.setStrokeWidth.. paint new Paint Paint.ANTI_ALIAS_FLAG paint.setStyle Paint.Style.STROKE paint.setStrokeWidth 2 paint.setColor Color.WHITE..

Code for changing the color of subtasks in Gantt Chart

http://stackoverflow.com/questions/8938690/code-for-changing-the-color-of-subtasks-in-gantt-chart

1L public MyRenderer super @Override public Paint getItemPaint int row int col System.out.println row col super.getItemPaint.. 1L public MyRenderer super @Override public Paint getItemPaint int row int col System.out.println row col super.getItemPaint.. int row int col System.out.println row col super.getItemPaint row col if row 0 return subtask1Color else if row 1 return..

How can I put axis on a .png file in java?

http://stackoverflow.com/questions/9843451/how-can-i-put-axis-on-a-png-file-in-java

shown here in which a custom renderer overrides getItemPaint . Color.getHSBColor is used to create a full spectrum of colors... java.awt.Color import java.awt.EventQueue import java.awt.Paint import java.awt.Shape import java.awt.geom.Ellipse2D import.. renderer.setSeriesShape 0 circle renderer.setSeriesPaint 0 line renderer.setUseFillPaint true renderer.setSeriesShapesFilled..