Create JInternalFrames and save the one which is selected

一世执手 提交于 2019-12-02 16:13:19

问题


I am learning Java now and I was wondering how to create JInternalFrames in a JFrame and save them as files. I draw some objects on the internal frames and I have a button 'Save'. For example, there are several of the internal frames and I want to save the one which is selected. May someone provide me with simple code on how to do this? Only the frames and how to save them.


回答1:


  1. Read the JDesktopPane API. You will find a method that will get you the currenctly selected internal frame.

  2. Check out Screen Image. This will allow you to create an image of any Swing component. It will also allow you to save this image to a file.



来源:https://stackoverflow.com/questions/44827053/create-jinternalframes-and-save-the-one-which-is-selected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!