0

i want to add print functionality to my software, this requires to compress the text not fit them in the textbox (letters should not be shrunk vertically).

is this possible with standard java methods or does someboday know good extensions?

i want to have the text like on the attached picture

Thanks!enter image description here

Loktar
  • 34,764
  • 7
  • 90
  • 104
user1857519
  • 119
  • 1
  • 2
  • 8

1 Answers1

1

You can try to override paintComponent() and apply horizontal scale to the Graphics instance

Graphics2D g2d=(Graphics2D)g;
AffineTransform old=g2d.getTransform();
g2d.scale(0.5, 1);
//paint the text here
g2d.setTransform(old);
StanislavL
  • 56,971
  • 9
  • 68
  • 98