[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?


Thread replies: 11
Thread images: 1

File: 2000px-Java-Logo.svg.png (218KB, 2000x3786px) Image search: [Google] [Yandex] [Bing]
2000px-Java-Logo.svg.png
218KB, 2000x3786px
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
[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.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK