aspose file tools*
The moose likes Applets and the fly likes drawRect(  ) with non integers arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "drawRect(  ) with non integers arguments" Watch "drawRect(  ) with non integers arguments" New topic
Author

drawRect( ) with non integers arguments

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi all
I'm trying to draw rectangles or any objects with passing parameters other than integeres to drawRect() or to object.setBounds() methods.The problem is i can't found a similar methods to accept floats or doubles .
i tried to use parse methods and convert my flots or doubles to integers and round() to round those nubers to the nearst int values,but when look into the graphs i see the same level
for all values that have decimal points between 0.5 to 0.9 and the same as 0.1 to 0.5.
I hope someone will help me with this.
thanks alot.
Pawel Veselov
Ranch Hand

Joined: Jan 14, 1999
Posts: 165
I don't quite get what you mean. The graphical information is represented by pixels. And there is no way pixel wide can be less or greater than 1, so it's impossible to draw line from 0.1 to 0.5.


With best of best regards, Pawel S. Veselov ( aka Black Angel )
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thanks for your time.
what i'm trying to do is to dev. a applet chart with Panel or canvas objects as bars.
i need to control the height of those objects using setbounds()
that accepts integers only.
i want to use floats or doubles to control the height of them.
for that when i pass the height value ffrom html file as 1.6 ,it will be as the height value 2 on the display screen and that is not right.
Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drawRect( ) with non integers arguments
 
Similar Threads
MATH CLASS
K&B chapter6 examwatch doubt
Having trouble choosing a data structure
Math issue
While loops