Skip to main content
Filter by
Sorted by
Tagged with
2 votes
0 answers
102 views

I'm working with an AWT Canvas with a triple buffered BufferStrategy. The application runs a loop that renders the screen with a set maximum FPS. Specifically I'm drawing multiple characters on screen ...
Marlo Kuisma's user avatar
1 vote
0 answers
48 views

I am creating a platformer game and currently working on the map area (where the player selects a level). While this code does work in eclipse, it does not work when exported to a .jar file. Yes, ...
TJ Hartnett's user avatar
1 vote
1 answer
144 views

(Specifically, I'm using Graphics2D, but it inherits the fillArc() method from Graphics, so I listed the question under that class.) The fillArc method accepts its parameters in the following order: ...
Eliezer Meth's user avatar
2 votes
0 answers
606 views

I am working on creating a Lambda function that uses Spring Boot. When the API is invoked, the application makes some API calls and creates an image containing some text, generated using Java ...
ryanmewhorter's user avatar
0 votes
2 answers
97 views

I'm following a java 2d game tutorial from ryisnow on youtube. https://www.youtube.com/watch?v=ugzxCcpoSdE I was able to display each tile on its own but I don't know why the .txt isnt working here is ...
Alan Morgan's user avatar
1 vote
1 answer
82 views

I am having an issue with a custom drawn image rendered on the JPanel with Graphics2D. If I try to draw a 1x1 pixel for every x/y the width and length of the panel with fillRect it will create a bunch ...
Matthew Wright's user avatar
0 votes
1 answer
96 views

I'm doing this graphing project, but I came across this problem: everytime I zoom in or out my x and y axis are out of place. Any idea of how to fix this issue? Here my code: import javafx....
alex huang's user avatar
0 votes
1 answer
269 views

I'm trying to draw a face with such unicodes: ಠ_ಠ However, it produces rectangles instead. I tried the following: BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB); ...
LeFlo's user avatar
  • 3
0 votes
0 answers
53 views

I need some help making my final project in java, a game. Here is the code I have now for jumping: if (Keys.up) { if (player[1] + player[3] >= base[1]) { player[5] = -20; } } This ...
Preston G's user avatar
0 votes
0 answers
62 views

x11 code //use x11 api for (int i = (xrectw >> 1) + cc; i < CANVAS_WIDTH; i += xrectw) { for (int j = (yrectw >> 1) + cc; j < CANVAS_HEIGHT; j += yrectw) { XDrawLine(...
A Mr's user avatar
  • 31
0 votes
1 answer
100 views

I want to teach my kids to write numbers, thus I thought of drawing traceable letters to Graphics2D I have tried the following approach float[] textDash = {15.0f}; g2d.setFont(g2d.getFont()....
Quillion's user avatar
  • 6,506
2 votes
0 answers
316 views

I'm working on an image editing application using React Konva and have encountered a challenge in implementing a dynamic cropping tool. My goal is to allow users to select a crop area on an image, ...
AlePouroullis's user avatar
1 vote
1 answer
53 views

I'm relatively new to programming in Java. I'm trying to create objects (apples) falling in different locations on the x-axis. However every time a new one is added to the ArrayList the image slows ...
vasilis tomaras's user avatar
0 votes
0 answers
20 views

I am dismayed at the poor quality of lines I draw in Graphics2D. When I draw a line with lineWidth=1 and strokeStyle="black" I would expect the line to look the same as the border of my ...
Chris B's user avatar
0 votes
1 answer
110 views

Just for fun and learning, I am trying to create a web based forms editor in the manner of Visual Studio. First requirement is the ability to draw a rectangle so that the outline follows the mouse ...
Chris B's user avatar
2 votes
2 answers
88 views

I want to antialiase an image with shape (plane) I draw in it. I draw the plane image in Adobe AI and put them in my resource folder. The image looks like below. When I use this line of code g2....
William Li's user avatar
1 vote
1 answer
51 views

I am attempting to get the intersection of two polygons via Area.intersect(), but in some cases I am getting a strange result. My code: import java.awt.Color; import java.awt.Graphics; import java.awt....
Joe's user avatar
  • 6,828
0 votes
1 answer
85 views

I'm stumped. I'm trying to draw a line in a Graphics 2D environment based upon a calculated value, and GeneralPath won't do it. Basically, I want to draw a straight line based on the formula y=sx+b ...
Z81's user avatar
  • 3
0 votes
1 answer
173 views

at 100% screen scaling the drawn shape is always "pixel perfect". at 125% screen scaling the same shape in this case it's sometimes drawn as if it has an extra row of pixels on the top (1) ...
Fraŋkini's user avatar
  • 127
1 vote
1 answer
42 views

The environment is Java 11 on a Raspberry Pi 3B+ with a 3.5" touchscreen. The program writes directly to the framebuffer with the aid of Thomas Welsch's JavaFrameBuffer JNI support. Things work ...
sodastream's user avatar
0 votes
1 answer
459 views

I am creating an application that involves drawing a BufferedImage to a JComponent using Graphics2D in a paintComponent(Graphics) method. I added the ability to zoom in and out of the image. The ...
davidalayachew's user avatar
0 votes
1 answer
125 views

Does anybody know how to change color when rendering SVG into PDF with pdfbox ? I am using following code: File svgFile = new File("roots.svg"); SVGUniverse svgUniverse = new SVGUniverse(); ...
ChristophDaniel's user avatar
-1 votes
1 answer
550 views

I have this code for Java Paint App. I have added a slider that changes from 1 to 20 with a default size of 1.This slider is for changing the strokeSize dynamically,so i have created a variable ...
Petarnan's user avatar
0 votes
1 answer
67 views

I am struggling with refreshing the graphics in a jpanel. I tried to make the JPanel extending class "ShadeSelectPane" update it's Graphics object everytime I use a JColorChooser to choose a ...
Das heilige Dönerhuhn's user avatar
1 vote
0 answers
177 views

my goal is to implement an image viewer, where one can zoom to the mouse position and the JScrollPane correctly response to this zoom gesture. Also the possibility to roate the image would be nice. I'...
Displayname's user avatar
2 votes
1 answer
143 views

I am trying to use the createPen/SelectObject GDI functions to change the DC pen in a VB6 simple program. The program is a vb6 form with Picture1 pictureBox control. It waits for the user to click ...
Emilio Nakhle Antoun's user avatar
0 votes
1 answer
81 views

I have written a test program using AffineTransform to draw an arrowhead. The program takes the center of the window as the starting point of the arrowhead and the mouse position as the ending point. ...
Jacky's user avatar
  • 45
0 votes
1 answer
57 views

I'm building a chess board, I'm going to layer two JPanels on top of each other , the bottom one "Sideline" should display the grid code, while the top one is gong to contain the actual game ...
JoeFuzz's user avatar
-3 votes
1 answer
291 views

If you have 4 points (xi,yi); 1<=i<=4 And you want to transform them like projective transformation to new points (Xi,Yi), how do you do it? It can be done with matrixes... Refer here for ...
Prem Sinha's user avatar
1 vote
1 answer
917 views

I want to start making a 2d video game, and I found a tutorial in java. However I wanted to use kotlin because I heard it is better, I am new to java and kotlin programming and I needed to put this ...
danny's user avatar
  • 72
0 votes
0 answers
49 views

I have a minesweeper project that uses pngs to paint the icons for my cells. For some reason, my paint/draw methods will fill in all of the cells except mines. Everything is in the same directory. In ...
jerome utti's user avatar
-1 votes
1 answer
427 views

My app draws dynamic complex graphics into SwiftUI Views. I understand that SwiftUI redraws Views when an observed variable changes, and that re-drawing a View deletes the existing View. What I would ...
KeithB's user avatar
  • 551
0 votes
1 answer
199 views

I am trying to keep a bounding box local to a buffered image after it is being rotated. Good day everyone. I am having an issue with a program I am currently working on. I draw an image to a buffered ...
Gizmo Dailys's user avatar
2 votes
1 answer
121 views

I'm trying to paint a Srtm3-Tile with the Help of Multithreading. If i use only a single Thread every works fine, but when i use Multithreading the graphic ends up in a mess. Currently i use 12 Cores -...
Neural Cortex's user avatar
3 votes
0 answers
119 views

When running the code below with Java 11 on Mac OS X the results differ from running it on Linux: The left side shows the output on Linux (no text anti-aliasing), the right side shows the output on ...
godfatherofpolka's user avatar
-2 votes
1 answer
465 views

when I spin the wheel I am unable to output the correct number that I have landed on (I always seem to get it 1 or more off depending on what i set the spinSpeed variable to). I have watched a video ...
user avatar
0 votes
0 answers
21 views

I want to draw a circle, then divide it into 24 equal sections, with different colors. Then add the corresponding number to each section (1 to 24) I'm facing an issue having all the numbers displayed, ...
Elia123456's user avatar
1 vote
0 answers
86 views

There are 3 elements painted on imageable area in the same way. But Java Print Service draws them differently depends on whether some conditions are repected. 2 conditions are respected when paint bug ...
vtsty.dev's user avatar
-1 votes
1 answer
121 views

Whenever I move the camera in a java game I'm working on, the edges of the tiles begin to flicker, and gaps appear between the seams, shown in the picture provided. image flickers I was following a ...
Oliver Langford's user avatar
2 votes
0 answers
398 views

I am using a GIF with a transparent background as a sprite for a game I am making as it is easier than manually animating each frame of the idle animation, especially since that is the only animation ...
Carter Reid's user avatar
1 vote
0 answers
87 views

I'm writing a graphics app in Jython 2.7, and am doing something fundamentally wrong. I've stripped out most of the code for this question, and with the following code I get "TypeError: setColor()...
HydronicsEng's user avatar
0 votes
0 answers
757 views

I'm creating a game while following a tutorial and I came across an error. It shows Graphics2D cannot be resolved to a type. I'm new to java and I'm using Eclipse IDE (JavaSE-12). I imported the ...
Paul's user avatar
  • 53
0 votes
0 answers
78 views

I am using code from How to get a random point on the interior of an irregular polygon? slightly modified in order to draw a random path2D by connecting random points together one after the other ...
jazznbass's user avatar
-2 votes
1 answer
507 views

I am using Java 8 (Spring Boot), and I want to add text (as watermark) to an image like this: As you see, the text HELLO WORLD! is rotated 90 degrees, and it has black background color (the grey ...
young-ceo's user avatar
  • 5,534
2 votes
0 answers
431 views

I have successfully read an SVG file into an org.w3c.dom.Document to see its structure. Now I'd like to render it to the screen using Java's AWT's Graphics2D. Note: I don't want to use Swing (e.g., ...
Brad Paley's user avatar
0 votes
0 answers
75 views

I created three classes: one is Gui class it includes JTable and JButton. public class Gui { public void Gui() { JFrame frame = new JFrame(); String data[][] = {}; String ...
tharinduhd's user avatar
1 vote
1 answer
359 views

java.lang.NullPointerException: Cannot read field "fillParallelogramLoop" because "sg2d.loops" is null at java.desktop/sun.java2d.pipe.LoopPipe.fillParallelogram(LoopPipe....
GZY_mingbai's user avatar
0 votes
1 answer
164 views

I am developing a navigation system in Java. The map should be drawn in the middle, with indicators on the left and right. How do I make the map slowly fade out on both sides? As shown above, the ...
DevJones's user avatar
-1 votes
1 answer
33 views

I've created an analogclock were u can type a digital time and the program draws a clock that shows the time and updates it self secondly. But at every update the old lines still remain. the variables ...
Maxe2016's user avatar
-1 votes
1 answer
78 views

I am relatively new to Java Swing and I have a use case where I have a single JPanel that needs to be divided into 2 equal sections horizontally. Each section needs to display a graph with added ...
Vaishu's user avatar
  • 1

1
2 3 4 5
34