1

I have a java based tool that displays every new canvas image in a new tab, and am planing to improve it with more functions. And soon its gona become complex tool have options to create images, viewing sequence images, thus having thought of using JInternal frame rather than JTabbedPane. So would like to know which would be better option in terms of efficiency,processing power and memory?

kleopatra
  • 51,061
  • 28
  • 99
  • 211
Balaram26
  • 1,349
  • 3
  • 15
  • 32

2 Answers2

2

I think it depends a lot of the size of the images and the way you actually want to display the images to users.

If you have very big images like 10+ of MPixels ones or your users don't need to see several images in the same time then you could go with the JTabbedPane. When you display only one image at a time, you can improve memory consumption by having only that image loaded into memory and probably keep the other images wrapped in SoftReference.

Dan D.
  • 32,246
  • 5
  • 63
  • 79
  • Thanks for the reply,the problem is that the new improvement that i am gona bring in the tool,involves creating image using drag and drop from fragments of images displayed on the canvas panal.nd tats y i wanted to first make sure which one is better ,so tat i could use it,rather than testing different options on tat stage would make things harder. Also the images that gona be created also contains text...... – Balaram26 Oct 02 '12 at 17:04
2

I'd go with JInternalFrame, illustrated here, as each frame can be resized individually. JTabbedPane, shown here, has a lot of appeal, but one-size-may-not-fit-all without scrolling. Only profiling such examples can realistically address efficiency, processing power and memory.

image

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Thanks for the reply,the problem is that the new improvement that i am gona bring in the tool,involves creating image using drag and drop from fragments of images displayed on the canvas panal.nd tats y i wanted to first make sure which one is better ,so tat i could use it,rather than testing different options on tat stage would make things harder. – Balaram26 Oct 02 '12 at 17:02
  • `JDesktop` with multiple `JInternalFrame` will be better than [multiple frames](http://stackoverflow.com/a/9554657/230513), as shown [here](http://stackoverflow.com/a/6310284/230513). – trashgod Oct 02 '12 at 17:12