Create JInternalFrames and save the one which is selected(创建 JInternalFrames 并保存选中的那个)
问题描述
我现在正在学习 Java,我想知道如何在 JFrame 中创建 JInternalFrames 并将它们保存为文件.我在内部框架上绘制了一些对象,并且有一个保存"按钮.例如,有几个内部框架,我想保存选中的那个.有人可以为我提供有关如何执行此操作的简单代码吗?只有帧以及如何保存它们.
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.
推荐答案
阅读
JDesktopPaneAPI.您会找到一种方法,可以让您获得当前选择的内部框架.
Read the
JDesktopPaneAPI. You will find a method that will get you the currenctly selected internal frame.
查看 屏幕图像.这将允许您创建任何 Swing 组件的图像.它还允许您将此图像保存到文件中.
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.
这篇关于创建 JInternalFrames 并保存选中的那个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:创建 JInternalFrames 并保存选中的那个
基础教程推荐
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 使用堆栈算法进行括号/括号匹配 2022-01-01
