[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
2D in Java?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 11
Thread images: 1
File: 2000px-Java-Logo.svg.png (218 KB, 2000x3786) Image search: [Google]
2000px-Java-Logo.svg.png
218 KB, 2000x3786
What is the easiest way to draw 2D lines, boxes and circles in Java?

And I'm just doing stuff like fractals and simple animated flocking so I am not interested in a big game framework like LibGDX.
>>
>>52034362
take a look at processing.org

Tailored for that imho.

Unless you need to make everything from scratch. Then take a look at https://docs.oracle.com/javase/tutorial/2d/

I don't want to sound like a dick but google your question.
>>
visit #java on freenode.
>>
>>52034362

>I don't want to sound like a dick but google your question.

When I do I get thousands of outdated and "do my homework for me" forum/blogspam.
>>
>>52034362
Java has a built in 2D API with primitives.
>>
>>52034856
https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html
https://docs.oracle.com/javase/tutorial/2d/geometry/primitives.html
>>
>>52034818
I get somewhat different results but most point to "use Java 2D Api". So that advice was unnecessary.

Try processing.org. It gives the same primitives (and much more) but helps avoiding a lot of the boilerplate code. It's also based on java.
>>
>>52034899
https://processing.org/examples/
>>
>>52034899
>>52034945

Thanks. Looks interesting.
>>
>>52034818
which is why IRC exists. for programming and other tech questions.
>>
>>52034362
Literally just make a class that extends JPanel and override the paint method on it. Easy peasy
Thread replies: 11
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.