编写的JFrame代码,如何能够同时被多个人打开
答案:1 悬赏:40 手机版
解决时间 2021-03-10 15:37
- 提问者网友:山高云阔
- 2021-03-10 09:48
编写的JFrame代码,如何能够同时被多个人打开
最佳答案
- 五星知识达人网友:狂恋
- 2021-03-10 10:04
import java.awt.BorderLayout;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
public class Test extends JFrame {
public Test() {
JDesktopPane desktop = new JDesktopPane();
JInternalFrame internal = new JInternalFrame();
internal.setSize(300, 200);
internal.setVisible(true);
desktop.add(internal);
add(desktop, BorderLayout.CENTER);
setSize(600, 400);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) throws Exception {
new Test();
}
}
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
public class Test extends JFrame {
public Test() {
JDesktopPane desktop = new JDesktopPane();
JInternalFrame internal = new JInternalFrame();
internal.setSize(300, 200);
internal.setVisible(true);
desktop.add(internal);
add(desktop, BorderLayout.CENTER);
setSize(600, 400);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) throws Exception {
new Test();
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯