¡@

Home 

java Programming Glossary: rectangle

non resizable window border and positioning

http://stackoverflow.com/questions/12529200/non-resizable-window-border-and-positioning

to setResizable this is done as expected. import java.awt.Rectangle import javax.swing.JFrame public class FrameBorders public static.. false frame2.setResizable false frame1.setVisible true Rectangle bounds frame1.getBounds frame2.setLocation bounds.x bounds.width..

the images are not loading

http://stackoverflow.com/questions/12642852/the-images-are-not-loading

@Override public void run draw 4 edges of rectangle Rectangle edges new Rectangle 0 getInsets .left 0 getInsets .top getSize.. void run draw 4 edges of rectangle Rectangle edges new Rectangle 0 getInsets .left 0 getInsets .top getSize .width getInsets.. Component tank Image image1 image2 Point location velocity Rectangle edges Random random public Fish Image image1 Image image2 Rectangle..

Collision detection with complex shapes

http://stackoverflow.com/questions/14574045/collision-detection-with-complex-shapes

3 new Area new Polygon xOther yOther 4 walls new Area new Rectangle 0 0 w h ActionListener animate new ActionListener @Override..

How to rotate an image gradually in Swing?

http://stackoverflow.com/questions/3405799/how-to-rotate-an-image-gradually-in-swing

java.awt.Graphics2D import java.awt.Image import java.awt.Rectangle import java.awt.Toolkit import java.awt.event.ActionEvent import.. this.initialize public void paintComponent Graphics grp Rectangle rect this.getBounds Graphics2D g2d Graphics2D grp g2d.setColor..

Java, how to draw constantly changing graphics

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

final Point p MouseInfo.getPointerInfo .getLocation Rectangle rect new Rectangle p.x 4 p.y 4 8 8 final BufferedImage capture.. MouseInfo.getPointerInfo .getLocation Rectangle rect new Rectangle p.x 4 p.y 4 8 8 final BufferedImage capture robot.createScreenCapture..

Is there a way to take a screenshot using Java and save it to some sort of image?

http://stackoverflow.com/questions/58305/is-there-a-way-to-take-a-screenshot-using-java-and-save-it-to-some-sort-of-image

on disk. I just tried it and the whole thing ends up like Rectangle screenRect new Rectangle Toolkit.getDefaultToolkit .getScreenSize.. and the whole thing ends up like Rectangle screenRect new Rectangle Toolkit.getDefaultToolkit .getScreenSize BufferedImage capture..

Smoothing a jagged path

http://stackoverflow.com/questions/7218309/smoothing-a-jagged-path

hackish attempt to get the outline of an image by adding a Rectangle iteratively to an Area . That was very slow. This example instead.. size 10 size 10 p.addPoint 10 size 10 Area a new Area p Rectangle r new Rectangle size 4 8 size 10 size 2 2 size 10 a.subtract.. 10 p.addPoint 10 size 10 Area a new Area p Rectangle r new Rectangle size 4 8 size 10 size 2 2 size 10 a.subtract new Area r int..

How to handle events from keyboard and mouse in full screen exclusive mode in java?

http://stackoverflow.com/questions/7456227/how-to-handle-events-from-keyboard-and-mouse-in-full-screen-exclusive-mode-in-ja

import java.awt.GraphicsEnvironment import java.awt.Rectangle import java.awt.event.ActionEvent import java.awt.event.ActionListener.. DisplayMode 1280 800 32 60 BufferStrategy bufferStrategy Rectangle bounds private static final long serialVersionUID 1L @param..

Stretch a JLabel text

http://stackoverflow.com/questions/8281886/stretch-a-jlabel-text

import java.awt.Graphics2D import java.awt.Rectangle import java.awt.RenderingHints import java.awt.font.FontRenderContext.. true true TextLayout layout new TextLayout label font frc Rectangle r layout.getPixelBounds null 0 0 System.out.println r BufferedImage..

Passing current Date

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

set fix size for animations otherwise some Start outside Rectangle 490 x 490 freeze or shaking on the screen my SSCCE import java.awt... RenderingHints.VALUE_ANTIALIAS_ON Rectangle bounds getViewport .getVisibleRect g2.scale bounds.getWidth..

Nice looking progress bar in java

http://stackoverflow.com/questions/8884297/nice-looking-progress-bar-in-java

import java.awt.Graphics2D import java.awt.Rectangle import java.awt.RenderingHints import javax.swing.JComponent.. class MyProgressUI extends BasicProgressBarUI private Rectangle r new Rectangle @Override protected void paintIndeterminate.. extends BasicProgressBarUI private Rectangle r new Rectangle @Override protected void paintIndeterminate Graphics g JComponent..

the images are not loading

http://stackoverflow.com/questions/12642852/the-images-are-not-loading

new Aquarium @Override public void run draw 4 edges of rectangle Rectangle edges new Rectangle 0 getInsets .left 0 getInsets.. loading code is wrong. Use ImageIO instead Don't store the rectangle reference directly. The problem is if the window is resized..

Drawing a rectangle that won't disappear in next paint

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

a rectangle that won't disappear in next paint I trying to create a JPanel.. in next paint I trying to create a JPanel that draws rectangles. The Panel needs to draw alot of rectangles but they dont move... that draws rectangles. The Panel needs to draw alot of rectangles but they dont move. One solution to my problem was to create..

Collision detection with complex shapes

http://stackoverflow.com/questions/14574045/collision-detection-with-complex-shapes

I don't want to use tiles which are much easier with rectangle collision and such is because there will be complex corners.. there will be complex corners and not everything will be rectangle. Is this a good idea and is it possible to do easily Would this.. ..there will be complex corners and not everything will be rectangle. This could be achieved by drawing and dealing with Shape and..

Android - SQlite Getting nearest locations (with latitude and longitude)

http://stackoverflow.com/questions/3695224/android-sqlite-getting-nearest-locations-with-latitude-and-longitude

to determine if your points in database are in that rectangle or not. The method calculateDerivedPosition ... calculates those..

Highlights subString in the TableCell(s) which is using for JTable filetering

http://stackoverflow.com/questions/6410839/highlights-substring-in-the-tablecells-which-is-using-for-jtable-filetering

the usual issues with text comps as renderers Finds the rectangles that contain rendered characters that match the pattern. @param.. viewR.height height insets.top Reset the text and view rectangle x any y coordinates. These are not set to 0 in SwingUtilities.layoutCompoundLabel.. textToSearch fm xOffset height Creates the rectangles that contain matched characters in the given text. @param text..

Drawing rectangle on a JPanel

http://stackoverflow.com/questions/9258890/drawing-rectangle-on-a-jpanel

rectangle on a JPanel I want to draw a recangle on a JPanel. Am able.. getContentPane .add basePanel If I do like this the rectangle is not getting visible. any idea And also I need to change the.. any idea And also I need to change the size of the rectangle at runtime. is it possible java swing jpanel paint share..

rotating coordinate plane for data and text in Java

http://stackoverflow.com/questions/9371961/rotating-coordinate-plane-for-data-and-text-in-java

which needs to be the bottom left corner of the inner blue rectangle in the code below . This will enable me to plot points at x.. int leftMargin ins.left set parameters for inner rectangle int hPad 10 int vPad 6 int testLeftStartPlotWindow ins.left.. blueHeight int blueBottom blueHeight blueTop plot outer rectangle g.setColor Color.red int redWidth width leftMargin 1 g.drawRect..