0

Is there a type of "pixel pane" where I can just say:

pixelX(10);
pixelY(20);

and it would put them at exactly those locations? Basically like setLayoutX() in JavaFX.

Luca Putzu
  • 1,438
  • 18
  • 24
Dmytro Lysak
  • 397
  • 1
  • 4
  • 11
  • Short answer is no, but you can make one, for [example](http://stackoverflow.com/questions/34344309/create-a-swing-gui-to-manipulate-png-pixel-by-pixel/34346818#34346818), this might be a little overboard for what you want, but the basic idea is there. Also have a look at [Painting in AWT and Swing](http://www.oracle.com/technetwork/java/painting-140037.html) and [Performing Custom Painting](http://docs.oracle.com/javase/tutorial/uiswing/painting/) – MadProgrammer Mar 11 '16 at 22:10
  • Java Swing GUIs have to work on different OS', screen size, screen resolution etc. using different PLAFs in different locales. As such, they are not conducive to pixel perfect layout. Instead use layout managers, or [combinations of them](http://stackoverflow.com/a/5630271/418556) along with layout padding and borders for [white space](http://stackoverflow.com/a/17874718/418556). – Andrew Thompson Mar 12 '16 at 00:03

0 Answers0