Skip to main content
Filter by
Sorted by
Tagged with
3 votes
0 answers
151 views

I’m generating text images for different .ttf fonts in a method using Java2D, most of the fonts it works fine. The issue is with some fonts it return wrong "Y" value. // params File ...
spring_dev101's user avatar
1 vote
1 answer
78 views

I am using client host commands from powershell to launch a Oracle forms FSAL via the following command: java -jar "fsal jar location" -url "url" This command works except there ...
IT Alex's user avatar
  • 200
0 votes
1 answer
104 views

I am using the java.awt.font.TextLayout class to measure the bounds of a text string. In this measurement I need to include any trailing whitespace. However it seems that by default, TextLayout ...
Grodriguez's user avatar
  • 22.1k
0 votes
1 answer
380 views

I am trying to figure out how to use PDFBox (2.0.30) to render image from a PDF document in a native application based on Spring Boot (3.2.1). PDF generation works fine, but image rendering fails. ...
Nicolas JANET's user avatar
0 votes
1 answer
111 views

My problem is I need to use only one drawLine. I couldn't figure out how am I supposed to make changes at the same time in x and y while not messing with one and another. I can't use a rectangle. int ...
Muhammed Argun's user avatar
0 votes
1 answer
229 views

I'm trying to make a game, and in the game is a background that has many small stars that slowly travel from right to left. With a full screen I may have 170 stars being drawn each frame. The ...
working_man's user avatar
-1 votes
1 answer
54 views

I want to draw some images on screen alongside some JButtons placed in different places of the screen. However whenever I have setLayout(null); the images do not show up on screen. If i don't set it ...
Zolak's user avatar
  • 23
0 votes
0 answers
51 views

How can I know if the user has clicked inside a Pentagon and a Ellipse? I was able to create a method for Circle, Triangle and Rect, but I got stucked in those two figures. Rect: public boolean ...
Sule26's user avatar
  • 1
0 votes
1 answer
199 views

I am having a problem with a school project in Which I create a Polygon that when I insert points the polygon update after the insertion of every point. For example My program: The result I want: ...
MJ99's user avatar
  • 5
1 vote
1 answer
48 views

I just started to learn Java and tried to draw some rectangles. I have run this example and can't understand one thing: class ShapesDemo2D has a constructor: public void init() { //Initialize ...
prupru's user avatar
  • 135
-1 votes
1 answer
667 views

I am making a java program that reads a binary file, which contains multiple images (in PNG format), and some binary data. How can i load the images (specifically, as java.awt.Image's) ? So far the ...
TwilCynder's user avatar
1 vote
1 answer
207 views

Well, lets say I have the Shape of an O and I want to render it. Now my current rendering code is this: public void fill(Shape shape, float xOffset, float yOffset) { AffineTransform transform ...
DasBabyPixel's user avatar
0 votes
1 answer
1k views

I know you can set the factor via -Dsun.java2d.uiScale=2 but what if I want to let the System choose the Value, how do I get the value set? Where is it saved?
Gianluca Corazza's user avatar
0 votes
1 answer
399 views

As the title states, I am trying to detect a mouse hover over an object that is not a JComponent. Right now I have a window with a green JPanel. When you left-click on this JPanel you create a point. ...
HygrowCarpets's user avatar
0 votes
2 answers
160 views

I have the following code. import java.awt.*; public class ShowScreenSize { public static void main(String[] args) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ...
Eddward's user avatar
0 votes
0 answers
258 views

I have a java application with old vector graphics editor written in pure Java Swing and Java2D. Now I want to migrate the whole application to Javafx toolkit, except graphics editor. Graphics editor ...
Koyotter's user avatar
0 votes
1 answer
93 views

The Java SE 8 app I'm developing needs to run on Win10 and MacOS, and I'm using a Font (Ariel) that renders well on both platforms: Here is an example of how it normally looks (MacOS 10.13): I was ...
pbierre's user avatar
  • 354
0 votes
1 answer
189 views

Using Java graphics, I tried to draw a circle, draw lines inside it, then check if the mouse is inside the circle and print the position of the mouse. The lines I draw exceed the circle and when I ...
lulyerenia's user avatar
0 votes
0 answers
166 views

I have to draw the figure on the link in java as an assignment.The assignment So far I have been able to draw the first arc using CubicCurve2D, as seen on the picture on the second link, but now I ...
Blend Sadikaj's user avatar
0 votes
1 answer
69 views

I have this strange problem with Java2D. I have a Path2D.Double that I want to draw, but depending on the stroke size, all segments are drawn correctly (curved) but when the stroke size is greater or ...
David Gutiérrez Rubio's user avatar
-1 votes
2 answers
111 views

This question was answered many time but I still can't apply it to my situation. I want to rotate image on 90 degrees clockwise. I'm currently having following code: private void writeImage(...
AstroCool's user avatar
1 vote
1 answer
64 views

I'm trying to make a game like Tank Trouble. The problem is that when I'm trying to rotate and draw a tank picture, all other tanks pictures will be rotated. Here is my code: // draw tanks ArrayList&...
ali asad's user avatar
0 votes
0 answers
54 views

my current project is a small desktop application in Java that functions like a room decorator similar to the IKEA software that lets you plan out your room before you go and buy furniture. When I ...
Sepx3's user avatar
  • 38
-1 votes
1 answer
456 views

I have BufferedImage that stores .png image (320 x 240) and I draw it on Сanvas with Graphics.drawImage(). But if you look closely, for example, the cross 3 by 3 pixels is actually 4 by 3 pixels. Look ...
Archer's user avatar
  • 67
3 votes
1 answer
505 views

I'm working on drawing semi-transparent images on top of other images for a small 2d game. To currently blend the images I'm using the formula found here: https://en.wikipedia.org/wiki/...
Zee Best's user avatar

1
2 3 4 5
22