JFrame中如何同时打开多个窗口 JFrame中包括好多个dialog,我现在做的是每次只能打开一个dialog,如何设置才能同时打开两个或者两个以上的dialog呢?请高手指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼主可以用MINI窗口。也就是JDeskTopPane。里面放的是JInternerFrame。可以在一个窗体中打开N个窗体,可以做到你想要打开几个就打开几个的 import java.awt.Color;import javax.swing.JDialog;public class Main { public static void main(String[] args) { // TODO Auto-generated method stub JDialog d1 = new JDialog(); d1.setSize(200, 200); d1.setLocation(0, 0); d1.getContentPane().setBackground(Color.BLACK); d1.setVisible(true); JDialog d2 = new JDialog(); d2.setSize(200, 200); d2.setLocation(200, 0); d2.getContentPane().setBackground(Color.RED); d2.setVisible(true); JDialog d3 = new JDialog(); d3.setSize(200, 200); d3.setLocation(0, 200); d3.getContentPane().setBackground(Color.GREEN); d3.setVisible(true); JDialog d4 = new JDialog(); d4.setSize(200, 200); d4.setLocation(200, 200); d4.getContentPane().setBackground(Color.YELLOW); d4.setVisible(true); }} repaint和paintComponent的问题,急~~~ 打印功能: 在Java中如何获得当前系统的进程信息? 初学者,求教instanceof运算符 为什么报错? 请问Java card的软件设计是怎样实现的? 发电子邮件一定要用Javamail才能发吗? awt中的事件编程!!大家看看小弟刚学!!! java程序员们,你们用java主要用来做什么(在线等待!!来则送分!!!!!!) 在Java2学习中的问题 jboss如何集群 try_finally_求解惑
import javax.swing.JDialog;public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
JDialog d1 = new JDialog();
d1.setSize(200, 200);
d1.setLocation(0, 0);
d1.getContentPane().setBackground(Color.BLACK);
d1.setVisible(true);
JDialog d2 = new JDialog();
d2.setSize(200, 200);
d2.setLocation(200, 0);
d2.getContentPane().setBackground(Color.RED);
d2.setVisible(true);
JDialog d3 = new JDialog();
d3.setSize(200, 200);
d3.setLocation(0, 200);
d3.getContentPane().setBackground(Color.GREEN);
d3.setVisible(true);
JDialog d4 = new JDialog();
d4.setSize(200, 200);
d4.setLocation(200, 200);
d4.getContentPane().setBackground(Color.YELLOW);
d4.setVisible(true);
}
}