2

I'm writing simple slide program in Java. In that program, I draw lines, ellipses, rectangles and etc in each slide. What is more, like a powerpoint I want to show all of my slides' symbolic small pictures on the JList.

How should I create small images from all elements in JPanel?

Thanks.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
CanCeylan
  • 2,890
  • 8
  • 41
  • 51

2 Answers2

2

You might look at capturing a panel's image using Screen Image, discussed here.

Addendum: See also ComponentImageCapture.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
0

If I understood your task correct, you must inherit from JPanel and overload method paintComponent(Graphics g). Inside you can write something like g.drawLine(0,0, 10, 10)

korifey
  • 3,379
  • 17
  • 17