English 中文(简体)
• 如何在浮点或两倍于确切的解决办法?
原标题:How to get mouse position in float or double with exact resolution?

我需要把烟火点放在浮或双倍的位置上,我如何能够这样做? 在摩擦听众中,我就这样说,

e.getPoint();

but Point object s x and y values are integer, I need position in float or double. Any help will be appreciated.

Edit I need exact resolution.

最佳回答
问题回答

从<条码>int, 您应能在无任何问题的情况下投到<条码> 。

double x = e.getPoint().x;
double y = e.getPoint().y;

然而,已经采取了以下方法:

double x = e.getPoint().getX();
double y = e.getPoint().getY();

我在这里找不到什么东西?

请注意,精确度不会更高,因为烟雾只能推向全食,因此通常会ger。 但是,如果你需要根据这些价值计算,那么浮动点的表述可能是有益的。

You cannot get a more precise point then getPoint(), wich returns a Point object that only holds two integers. What would like to achieve with this?





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签