Search code examples
javagraphicsplotdrawingpixel

Java: basic plotting, drawing a point/dot/pixel


I need to just have a panel inside of which i'd be able to draw. I want to be able to draw pixel by pixel.

ps: I don't need lines/circles other primitives. pps: the graphics library does not really matter, it can be awt, swing, qt.. anything. I just want to have something that is usually represented by Bufferedimage or somethign like that where you set colors of single pixels and then render it to the screen.


Solution

  • represented by Bufferedimage ..

    I suggest a BufferedImage for that, displayed..

    ..or something like that where you set colors of single pixels and then render it to the screen.

    ..in a JLabel - as seen in this answer.

    Of course, once we have an instance of BufferedImage, we can setRGB(..).